forked from jaildesigner-jailgames/coffee_crisis
before change player animation
This commit is contained in:
@@ -32,6 +32,7 @@ void Player::init(float x, int y, LTexture *textureLegs, LTexture *textureBody,
|
||||
mInvulnerableCounter = PLAYER_INVULNERABLE_COUNTER;
|
||||
mExtraHit = false;
|
||||
mCoffees = 0;
|
||||
mInput = true;
|
||||
|
||||
// Establece la altura y el ancho del jugador
|
||||
mWidth = 3 * BLOCK;
|
||||
@@ -726,16 +727,40 @@ bool Player::hasExtraHit()
|
||||
void Player::giveExtraHit()
|
||||
{
|
||||
mExtraHit = true;
|
||||
mCoffees++;
|
||||
if (mCoffees > 2)
|
||||
mCoffees = 2;
|
||||
}
|
||||
|
||||
// Quita el toque extra al jugador
|
||||
void Player::removeExtraHit()
|
||||
{
|
||||
mExtraHit = false;
|
||||
if (mCoffees > 0)
|
||||
mCoffees--;
|
||||
if (mCoffees == 0)
|
||||
mExtraHit = false;
|
||||
mInvulnerable = true;
|
||||
mInvulnerableCounter = PLAYER_INVULNERABLE_COUNTER;
|
||||
}
|
||||
|
||||
// Habilita la entrada de ordenes
|
||||
void Player::enableInput()
|
||||
{
|
||||
mInput = true;
|
||||
}
|
||||
|
||||
// Deshabilita la entrada de ordenes
|
||||
void Player::disableInput()
|
||||
{
|
||||
mInput = false;
|
||||
}
|
||||
|
||||
// Devuelve el numero de cafes actuales
|
||||
Uint8 Player::getCoffees()
|
||||
{
|
||||
return mCoffees;
|
||||
}
|
||||
|
||||
// Obtiene el circulo de colisión
|
||||
Circle &Player::getCollider()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user