Treballant en el final del joc

This commit is contained in:
2024-10-31 11:58:01 +01:00
parent 7e2691e33e
commit 30dfa4c545
7 changed files with 502 additions and 656 deletions

View File

@@ -200,17 +200,11 @@ void Balloon::move()
}
}
// Deshabilita el globo y pone a cero todos los valores
void Balloon::disable()
{
enabled_ = false;
}
// Deshabilita el globo
void Balloon::disable() { enabled_ = false; }
// Explosiona el globo
void Balloon::pop()
{
disable();
}
void Balloon::pop() { disable(); }
// Actualiza al globo a su posicion, animación y controla los contadores
void Balloon::update()
@@ -296,60 +290,6 @@ void Balloon::setAnimation()
sprite_->setCurrentAnimation(isBeingCreated() ? creating_animation : normal_animation);
}
// Comprueba si el globo está habilitado
bool Balloon::isEnabled() const
{
return enabled_;
}
// Obtiene del valor de la variable
float Balloon::getPosX() const
{
return x_;
}
// Obtiene del valor de la variable
float Balloon::getPosY() const
{
return y_;
}
// Obtiene del valor de la variable
int Balloon::getWidth() const
{
return w_;
}
// Obtiene del valor de la variable
int Balloon::getHeight() const
{
return h_;
}
// Establece el valor de la variable
void Balloon::setVelY(float vel_y)
{
vy_ = vel_y;
}
// Establece el valor de la variable
void Balloon::setSpeed(float speed)
{
speed_ = speed;
}
// Obtiene el tamaño del globo
BalloonSize Balloon::getSize() const
{
return size_;
}
// Obtiene el tipo de globo
BalloonType Balloon::getType() const
{
return type_;
}
// Detiene el globo
void Balloon::stop()
{
@@ -366,42 +306,6 @@ void Balloon::start()
sprite_->enableRotate();
}
// Obtiene del valor de la variable
bool Balloon::isStopped() const
{
return stopped_;
}
// Establece el valor de la variable
void Balloon::setInvulnerable(bool value)
{
invulnerable_ = value;
}
// Obtiene del valor de la variable
bool Balloon::isInvulnerable() const
{
return invulnerable_;
}
// Obtiene del valor de la variable
bool Balloon::isBeingCreated() const
{
return being_created_;
}
// Obtiene del valor de la variable
Uint16 Balloon::getScore() const
{
return score_;
}
// Obtiene el circulo de colisión
Circle &Balloon::getCollider()
{
return collider_;
}
// Alinea el circulo de colisión con la posición del objeto globo
void Balloon::shiftColliders()
{
@@ -423,18 +327,6 @@ void Balloon::zoomSprite()
sprite_->setZoomH(bouncing_.zoomH);
}
// Obtiene le valor de la variable
Uint8 Balloon::getMenace() const
{
return isEnabled() ? menace_ : 0;
}
// Obtiene le valor de la variable
Uint8 Balloon::getPower() const
{
return power_;
}
// Activa el efecto
void Balloon::enableBounce()
{
@@ -471,18 +363,6 @@ void Balloon::updateBounce()
}
}
// Indica si el globo se puede explotar
bool Balloon::canBePopped() const
{
return isEnabled() && !isBeingCreated();
}
// Indica si el globo se puede destruir
bool Balloon::canBeDestroyed() const
{
return isEnabled();
}
// Pone el color alternativo en el globo
void Balloon::useReverseColor()
{
@@ -500,8 +380,25 @@ void Balloon::useNormalColor()
setAnimation();
}
// Indica si está usando el color alternativo
bool Balloon::isUsingReversedColor()
{
return use_reversed_colors_;
}
// Getters
float Balloon::getPosX() const { return x_; }
float Balloon::getPosY() const { return y_; }
int Balloon::getWidth() const { return w_; }
int Balloon::getHeight() const { return h_; }
BalloonSize Balloon::getSize() const { return size_; }
BalloonType Balloon::getType() const { return type_; }
Uint16 Balloon::getScore() const { return score_; }
Circle &Balloon::getCollider() { return collider_; }
Uint8 Balloon::getMenace() const { return isEnabled() ? menace_ : 0; }
Uint8 Balloon::getPower() const { return power_; }
bool Balloon::isStopped() const { return stopped_; }
bool Balloon::isInvulnerable() const { return invulnerable_; }
bool Balloon::isBeingCreated() const { return being_created_; }
bool Balloon::isEnabled() const { return enabled_; }
bool Balloon::isUsingReversedColor() { return use_reversed_colors_; }
bool Balloon::canBePopped() const { return !isBeingCreated(); }
// Setters
void Balloon::setVelY(float vel_y) { vy_ = vel_y; }
void Balloon::setSpeed(float speed) { speed_ = speed; }
void Balloon::setInvulnerable(bool value) { invulnerable_ = value; }