Açò ja no hi ha Cristo que ho pete

This commit is contained in:
2024-10-10 13:48:53 +02:00
parent fc8fdc5fe5
commit 9e5f41644e
7 changed files with 27 additions and 23 deletions

View File

@@ -510,8 +510,11 @@ void AnimatedSprite::setCurrentAnimation(int index)
// Actualiza las variables del objeto
void AnimatedSprite::update()
{
if (enabled_)
{
animate();
MovingSprite::update();
}
}
// Establece el rectangulo para un frame de una animación

View File

@@ -1049,7 +1049,7 @@ void Game::updateBalloonSpeed()
}
// Explosiona un globo. Lo destruye y crea otros dos si es el caso
void Game::popBalloon(std::shared_ptr<Balloon> &balloon)
void Game::popBalloon(std::shared_ptr<Balloon> balloon)
{
// Aumenta el poder de la fase
increaseStageCurrentPower(1);
@@ -1072,11 +1072,11 @@ void Game::popBalloon(std::shared_ptr<Balloon> &balloon)
}
else
{ // En cualquier otro caso, crea dos globos de un tipo inferior
const auto bLeft = createBalloon(0, balloon->getPosY(), balloon->getKind() - 1, BALLOON_VELX_NEGATIVE, enemySpeed, 0);
auto bLeft = createBalloon(0, balloon->getPosY(), balloon->getKind() - 1, BALLOON_VELX_NEGATIVE, enemySpeed, 0);
bLeft->allignTo(balloon->getPosX() + (balloon->getWidth() / 2));
bLeft->setVelY(bLeft->getClass() == BALLOON_CLASS ? -2.50f : BALLOON_VELX_NEGATIVE);
const auto bRight = createBalloon(0, balloon->getPosY(), balloon->getKind() - 1, BALLOON_VELX_POSITIVE, enemySpeed, 0);
auto bRight = createBalloon(0, balloon->getPosY(), balloon->getKind() - 1, BALLOON_VELX_POSITIVE, enemySpeed, 0);
bRight->allignTo(balloon->getPosX() + (balloon->getWidth() / 2));
bRight->setVelY(bRight->getClass() == BALLOON_CLASS ? -2.50f : BALLOON_VELX_NEGATIVE);

View File

@@ -277,7 +277,7 @@ private:
void updateBalloonSpeed();
// Explosiona un globo. Lo destruye y crea otros dos si es el caso
void popBalloon(std::shared_ptr<Balloon> &balloon);
void popBalloon(std::shared_ptr<Balloon> balloon);
// Explosiona un globo. Lo destruye
void destroyBalloon(std::shared_ptr<Balloon> &balloon);

View File

@@ -68,7 +68,10 @@ void MovingSprite::move()
// Muestra el sprite por pantalla
void MovingSprite::render()
{
if (enabled_)
{
texture_->render((int)x_, (int)y_, &spriteClip_, zoomW_, zoomH_, angle_, center_, currentFlip_);
}
}
// Obtiene el valor de la variable
@@ -259,9 +262,12 @@ void MovingSprite::disableRotate()
// Actualiza las variables internas del objeto
void MovingSprite::update()
{
if (enabled_)
{
move();
rotate();
++counter_ %= 60000;
}
}
// Cambia el sentido de la rotación

View File

@@ -232,7 +232,7 @@ void Screen::setVideoMode(ScreenVideoMode videoMode)
// Reinicia los shaders
if (options.video.shaders)
{
#ifdef SHADERS
#ifndef NO_SHADERS
std::ifstream f(asset->get("crtpi.glsl").c_str());
std::string source((std::istreambuf_iterator<char>(f)), std::istreambuf_iterator<char>());

View File

@@ -19,20 +19,18 @@ void SmartSprite::init()
destX_ = 0;
destY_ = 0;
finished_ = false;
enabled_ = false;
}
// Actualiza la posición y comprueba si ha llegado a su destino
void SmartSprite::update()
{
if (enabled_)
{
MovingSprite::update();
checkMove();
checkFinished();
}
// Pinta el objeto en pantalla
void SmartSprite::render()
{
MovingSprite::render();
}
}
// Establece el valor de la variable

View File

@@ -34,9 +34,6 @@ public:
// Actualiza la posición y comprueba si ha llegado a su destino
void update();
// Pinta el objeto en pantalla
void render();
// Establece el valor de la variable
void setFinishedCounter(int value);