Los items ya parecen funcionar. revisar power ball y los puntos al coger items
This commit is contained in:
@@ -7,11 +7,11 @@ Balloon::Balloon(float x, float y, Uint8 kind, float velx, float speed, Uint16 c
|
||||
mSprite = new AnimatedSprite(texture, renderer, file);
|
||||
disable();
|
||||
|
||||
mEnabled = true;
|
||||
|
||||
switch (kind)
|
||||
{
|
||||
case BALLOON_1:
|
||||
mEnabled = true;
|
||||
|
||||
// Alto y ancho del objeto
|
||||
mWidth = BALLOON_WIDTH_1;
|
||||
mHeight = BALLOON_WIDTH_1;
|
||||
@@ -34,8 +34,6 @@ Balloon::Balloon(float x, float y, Uint8 kind, float velx, float speed, Uint16 c
|
||||
break;
|
||||
|
||||
case BALLOON_2:
|
||||
mEnabled = true;
|
||||
|
||||
// Alto y ancho del objeto
|
||||
mWidth = BALLOON_WIDTH_2;
|
||||
mHeight = BALLOON_WIDTH_2;
|
||||
@@ -58,8 +56,6 @@ Balloon::Balloon(float x, float y, Uint8 kind, float velx, float speed, Uint16 c
|
||||
break;
|
||||
|
||||
case BALLOON_3:
|
||||
mEnabled = true;
|
||||
|
||||
// Alto y ancho del objeto
|
||||
mWidth = BALLOON_WIDTH_3;
|
||||
mHeight = BALLOON_WIDTH_3;
|
||||
@@ -82,8 +78,6 @@ Balloon::Balloon(float x, float y, Uint8 kind, float velx, float speed, Uint16 c
|
||||
break;
|
||||
|
||||
case BALLOON_4:
|
||||
mEnabled = true;
|
||||
|
||||
// Alto y ancho del objeto
|
||||
mWidth = BALLOON_WIDTH_4;
|
||||
mHeight = BALLOON_WIDTH_4;
|
||||
@@ -106,8 +100,6 @@ Balloon::Balloon(float x, float y, Uint8 kind, float velx, float speed, Uint16 c
|
||||
break;
|
||||
|
||||
case HEXAGON_1:
|
||||
mEnabled = true;
|
||||
|
||||
// Alto y ancho del objeto
|
||||
mWidth = BALLOON_WIDTH_1;
|
||||
mHeight = BALLOON_WIDTH_1;
|
||||
@@ -130,8 +122,6 @@ Balloon::Balloon(float x, float y, Uint8 kind, float velx, float speed, Uint16 c
|
||||
break;
|
||||
|
||||
case HEXAGON_2:
|
||||
mEnabled = true;
|
||||
|
||||
// Alto y ancho del objeto
|
||||
mWidth = BALLOON_WIDTH_2;
|
||||
mHeight = BALLOON_WIDTH_2;
|
||||
@@ -154,8 +144,6 @@ Balloon::Balloon(float x, float y, Uint8 kind, float velx, float speed, Uint16 c
|
||||
break;
|
||||
|
||||
case HEXAGON_3:
|
||||
mEnabled = true;
|
||||
|
||||
// Alto y ancho del objeto
|
||||
mWidth = BALLOON_WIDTH_3;
|
||||
mHeight = BALLOON_WIDTH_3;
|
||||
@@ -178,8 +166,6 @@ Balloon::Balloon(float x, float y, Uint8 kind, float velx, float speed, Uint16 c
|
||||
break;
|
||||
|
||||
case HEXAGON_4:
|
||||
mEnabled = true;
|
||||
|
||||
// Alto y ancho del objeto
|
||||
mWidth = BALLOON_WIDTH_4;
|
||||
mHeight = BALLOON_WIDTH_4;
|
||||
@@ -202,8 +188,6 @@ Balloon::Balloon(float x, float y, Uint8 kind, float velx, float speed, Uint16 c
|
||||
break;
|
||||
|
||||
case POWER_BALL:
|
||||
mEnabled = true;
|
||||
|
||||
// Alto y ancho del objeto
|
||||
mWidth = BALLOON_WIDTH_4;
|
||||
mHeight = BALLOON_WIDTH_4;
|
||||
@@ -231,8 +215,6 @@ Balloon::Balloon(float x, float y, Uint8 kind, float velx, float speed, Uint16 c
|
||||
break;
|
||||
|
||||
default:
|
||||
mEnabled = false;
|
||||
mMenace = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -456,7 +438,7 @@ void Balloon::disable()
|
||||
mSpeed = 0;
|
||||
mStopped = false;
|
||||
mStoppedCounter = 0;
|
||||
mTimeToLive = 0;
|
||||
//mTimeToLive = 0;
|
||||
mTravelY = 0;
|
||||
mVelX = 0.0f;
|
||||
mVelY = 0.0f;
|
||||
@@ -469,9 +451,7 @@ void Balloon::disable()
|
||||
void Balloon::pop()
|
||||
{
|
||||
setPopping(true);
|
||||
mSprite->setAnimationCounter(0);
|
||||
mSprite->disableRotate();
|
||||
setTimeToLive(120);
|
||||
setStop(true);
|
||||
setStoppedTimer(2000);
|
||||
setInvulnerable(true);
|
||||
@@ -503,18 +483,18 @@ void Balloon::updateState()
|
||||
setStop(true);
|
||||
if (mSprite->animationIsCompleted())
|
||||
{
|
||||
mSprite->setAnimationCompleted(BALLOON_POP_ANIMATION, false);
|
||||
mTimeToLive = 0;
|
||||
//mSprite->setAnimationCompleted(BALLOON_POP_ANIMATION, false);
|
||||
//mTimeToLive = 0;
|
||||
disable();
|
||||
}
|
||||
else if (mTimeToLive > 0)
|
||||
/*else if (mTimeToLive > 0)
|
||||
{
|
||||
mTimeToLive--;
|
||||
}
|
||||
else
|
||||
{
|
||||
disable();
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
// Si se está creando
|
||||
@@ -757,18 +737,6 @@ bool Balloon::isPopping()
|
||||
return mPopping;
|
||||
}
|
||||
|
||||
// Establece el valor de la variable
|
||||
void Balloon::setTimeToLive(Uint16 time)
|
||||
{
|
||||
mTimeToLive = time;
|
||||
}
|
||||
|
||||
// Obtiene del valor de la variable
|
||||
Uint16 Balloon::getTimeToLive()
|
||||
{
|
||||
return mTimeToLive;
|
||||
}
|
||||
|
||||
// Establece el valor de la variable
|
||||
void Balloon::setStoppedTimer(Uint16 time)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user