Afegits roidets de colisió per als globos per a certs moments
This commit is contained in:
@@ -17,6 +17,7 @@ constexpr int BALLOON_SCORE[] = {50, 100, 200, 400};
|
||||
constexpr int BALLOON_POWER[] = {1, 3, 7, 15};
|
||||
constexpr int BALLOON_MENACE[] = {1, 2, 4, 8};
|
||||
constexpr int BALLOON_SIZE[] = {10, 16, 26, 48, 49};
|
||||
const std::string BALLOON_SOUND[] = {"bubble1.wav", "bubble2.wav", "bubble3.wav", "bubble4.wav"};
|
||||
|
||||
// Tamaños de globo
|
||||
enum class BalloonSize : Uint8
|
||||
@@ -113,6 +114,8 @@ private:
|
||||
float speed_; // Velocidad a la que se mueven los globos
|
||||
Uint8 power_; // Cantidad de poder que alberga el globo
|
||||
SDL_Rect play_area_; // Zona por donde se puede mover el globo
|
||||
std::string sound_; // Archivo de sonido que hace el globo al rebotar
|
||||
bool sound_enabled_ = false; // Indica si ha de sonar el sonido del globo al rebotar
|
||||
|
||||
// Alinea el circulo de colisión con la posición del objeto globo
|
||||
void shiftColliders();
|
||||
@@ -138,6 +141,9 @@ private:
|
||||
// Establece la animación correspondiente
|
||||
void setAnimation();
|
||||
|
||||
// Reproduce el sonido al rebotar
|
||||
void playSound();
|
||||
|
||||
public:
|
||||
// Constructor
|
||||
Balloon(
|
||||
@@ -208,4 +214,5 @@ public:
|
||||
void setVelY(float vel_y) { vy_ = vel_y; }
|
||||
void setSpeed(float speed) { speed_ = speed; }
|
||||
void setInvulnerable(bool value) { invulnerable_ = value; }
|
||||
void setSound(bool value) { sound_enabled_ = value; }
|
||||
};
|
||||
Reference in New Issue
Block a user