예제 #1
0
void Vehicle::setMaxDamage(int newMaxDamage)
{
	maxDamage = newMaxDamage;
	if( damage>=maxDamage)
	{
		setIsAlive(false);
	}
}
예제 #2
0
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];
}
예제 #4
0
void Pokemon::setCurrentHP(double curHP)
{
	if (curHP < 0)
	{
		_curHP = 0;
		setIsAlive(false);
	}
	else if (curHP > getHP())
		_curHP = getHP();
	else
		_curHP = curHP;
}
예제 #5
0
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;
}
예제 #6
0
void EnemyBase::kill()
{
    setIsAlive(false);
    setPos(-100, -100);
    lives = MAX_LIVES;
}