Retocado el borde de la powerball y quitados los efectos de rebote

This commit is contained in:
2022-10-04 16:58:10 +02:00
parent 9f93de1d06
commit 5fd1ffa865
6 changed files with 47 additions and 24 deletions

View File

@@ -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();
}
}
/*