diff --git a/data/gfx/balloon4.ani b/data/gfx/balloon4.ani index 1db5a21..abd9c7a 100644 --- a/data/gfx/balloon4.ani +++ b/data/gfx/balloon4.ani @@ -31,7 +31,7 @@ frames=36,37,38,39,40,41,42,43,44,45 [animation] name=powerball -speed=20 +speed=10 loop=0 frames=48 [/animation] diff --git a/data/gfx/balloon4.png b/data/gfx/balloon4.png index f5f63da..8608d57 100644 Binary files a/data/gfx/balloon4.png and b/data/gfx/balloon4.png differ diff --git a/source/animatedsprite.cpp b/source/animatedsprite.cpp index 9cb2ae6..c11924f 100644 --- a/source/animatedsprite.cpp +++ b/source/animatedsprite.cpp @@ -325,7 +325,7 @@ bool AnimatedSprite::loadFromVector(std::vector *source) // Recorre todo el vector int index = 0; - while (index < source->size()) + while (index < (int)source->size()) { // Lee desde el vector line = source->at(index); diff --git a/source/balloon.cpp b/source/balloon.cpp index 53e0949..6bdb26e 100644 --- a/source/balloon.cpp +++ b/source/balloon.cpp @@ -209,7 +209,7 @@ Balloon::Balloon(float x, float y, Uint8 kind, float velx, float speed, Uint16 c // Añade rotación al sprite mSprite->setRotate(false); - mSprite->setRotateSpeed(1); + mSprite->setRotateSpeed(0); mSprite->setRotateAmount(2.0); break; @@ -254,8 +254,8 @@ Balloon::Balloon(float x, float y, Uint8 kind, float velx, float speed, Uint16 c mVisible = true; mInvulnerable = true; mBeingCreated = true; - mCreationCounter = creationtimer; - mCreationCounterIni = creationtimer; + mCreationCounter = creationtimer; + mCreationCounterIni = creationtimer; mPopping = false; mCounter = 0; @@ -300,31 +300,41 @@ void Balloon::render() { if (mBouncing.enabled) { - // Aplica desplazamiento para el zoom - mSprite->setPosX(getPosX() + mBouncing.despX); - mSprite->setPosY(getPosY() + mBouncing.despY); - mSprite->render(); - mSprite->setPosX(getPosX() - mBouncing.despX); - mSprite->setPosY(getPosY() - mBouncing.despY); + if (mKind != POWER_BALL) + { + // Aplica desplazamiento para el zoom + mSprite->setPosX(getPosX() + mBouncing.despX); + mSprite->setPosY(getPosY() + mBouncing.despY); + mSprite->render(); + mSprite->setPosX(getPosX() - mBouncing.despX); + mSprite->setPosY(getPosY() - mBouncing.despY); + } } else if (isBeingCreated()) { // Aplica alpha blending mSprite->getTexture()->setAlpha(255 - (int)((float)mCreationCounter * (255.0f / (float)mCreationCounterIni))); mSprite->render(); + if (mKind == POWER_BALL) + { + Sprite *sp = new Sprite(mSprite->getRect(), mSprite->getTexture(), mSprite->getRenderer()); + sp->setSpriteClip(370, 148, 37, 37); + sp->render(); + delete sp; + } mSprite->getTexture()->setAlpha(255); } else { mSprite->render(); - } - if (mKind == POWER_BALL) - { - Sprite *sp = new Sprite(mSprite->getRect() ,mSprite->getTexture(),mSprite->getRenderer()); - sp->setSpriteClip(370,148,37,37); - sp->render(); - delete sp; + if (mKind == POWER_BALL) + { + Sprite *sp = new Sprite(mSprite->getRect(), mSprite->getTexture(), mSprite->getRenderer()); + sp->setSpriteClip(370, 148, 37, 37); + sp->render(); + delete sp; + } } } } @@ -351,7 +361,10 @@ void Balloon::move() mSprite->switchRotate(); // Activa el efecto de rebote - bounceStart(); + if (mKind != POWER_BALL) + { + bounceStart(); + } } // Mueve el globo hacia arriba o hacia abajo @@ -367,7 +380,10 @@ void Balloon::move() mVelY = -mVelY; // Activa el efecto de rebote - bounceStart(); + if (mKind != POWER_BALL) + { + bounceStart(); + } } // Si el globo se sale por la parte inferior @@ -380,7 +396,10 @@ void Balloon::move() mVelY = -mDefaultVelY; // Activa el efecto de rebote - bounceStart(); + if (mKind != POWER_BALL) + { + bounceStart(); + } } /* diff --git a/source/game.cpp b/source/game.cpp index 515d4ca..ffbbfe0 100644 --- a/source/game.cpp +++ b/source/game.cpp @@ -15,7 +15,7 @@ Game::Game(int numPlayers, int currentStage, SDL_Renderer *renderer, Screen *scr // Pasa variables mDemo.enabled = demo; mNumPlayers = numPlayers; - mCurrentStage = currentStage; + mCurrentStage = 4;//currentStage; mLastStageReached = currentStage; if (mNumPlayers == 1) { @@ -2695,7 +2695,7 @@ void Game::update() // Comprueba el nivel de amenaza para ver si se han de crear nuevos enemigos if (!mGameCompleted) { - updateMenace(); + //updateMenace(); } // Actualiza la velocidad de los enemigos diff --git a/source/movingsprite.cpp b/source/movingsprite.cpp index 291eca2..4588c40 100644 --- a/source/movingsprite.cpp +++ b/source/movingsprite.cpp @@ -251,7 +251,11 @@ void MovingSprite::rotate() if (enabled) if (rotateEnabled) { - if (counter % rotateSpeed == 0) + if (rotateSpeed == 0) + { + incAngle(rotateAmount); + } + else if (counter % rotateSpeed == 0) { incAngle(rotateAmount); }