added power up on the player

This commit is contained in:
2021-08-21 20:39:48 +02:00
parent 182631b2b7
commit 837306f16e
11 changed files with 203 additions and 27 deletions

View File

@@ -33,6 +33,8 @@ private:
Uint16 mInvulnerableCounter; // Temporizador para la invulnerabilidad
bool mExtraHit; // Indica si el jugador tiene un toque extra
Uint8 mCoffees; // Indica cuantos cafes lleva acumulados
bool mPowerUp; // Indica si el jugador tiene activo el modo PowerUp
Uint16 mPowerUpCounter; // Temporizador para el modo PowerUp
bool mInput; // Indica si puede recibir ordenes de entrada
AnimatedSprite *mSpriteLegs; // Sprite para dibujar las piernas
@@ -50,7 +52,7 @@ public:
~Player();
// Iniciador
void init(float x, int y, LTexture *textureLegs, LTexture *textureBody, SDL_Renderer *renderer);
void init(float x, int y, LTexture *textureLegs, LTexture *textureBody, LTexture *textureHead, SDL_Renderer *renderer);
// Actua en consecuencia de la entrada recibida
void setInput(Uint8 input);
@@ -134,6 +136,21 @@ public:
// Actualiza el valor de la variable
void updateInvulnerableCounter();
// Obtiene el valor de la variable
bool isPowerUp();
// Establece el valor de la variable
void setPowerUp(bool value);
// Obtiene el valor de la variable
Uint16 getPowerUpCounter();
// Establece el valor de la variable
void setPowerUpCounter(Uint16 value);
// Actualiza el valor de la variable
void updatePowerUpCounter();
// Obtiene el valor de la variable
bool hasExtraHit();