void Vehicle::setMaxDamage(int newMaxDamage) { maxDamage = newMaxDamage; if( damage>=maxDamage) { setIsAlive(false); } }
void Vehicle::applyDamage(int newDamage) { damage +=newDamage; if( damage>=maxDamage) { setIsAlive(false); } }
void CC3MortalPointParticle::updateBeforeTransform( CC3NodeUpdatingVisitor* visitor ) { GLfloat dt = visitor->getDeltaTime(); m_timeToLive -= dt; if (m_timeToLive <= 0.0f) setIsAlive( false ); //else // [((id<CC3MortalPointParticleDeprecated>)self) updateLife: dt]; }
void Pokemon::setCurrentHP(double curHP) { if (curHP < 0) { _curHP = 0; setIsAlive(false); } else if (curHP > getHP()) _curHP = getHP(); else _curHP = curHP; }
bool Player::init() { if (Entity::init()) { setTotalStamina(600); setStaminaReduce(6); setScore(0); setPickUpDistance(60); setIsAlive(true); setIsUpSpeed(false); setIsMagnet(false); setIsDizzy(false); //return true; } return true; }
void EnemyBase::kill() { setIsAlive(false); setPos(-100, -100); lives = MAX_LIVES; }