working on class sections
This commit is contained in:
@@ -54,30 +54,32 @@ void Item::init(Uint8 value, float x, float y, LTexture *texture, SDL_Renderer *
|
||||
mVelX = 0;
|
||||
mVelY = 0;
|
||||
break;
|
||||
|
||||
case ITEM_POINTS_1_DISK:
|
||||
mSprite->setAnimationFrames(0, 0, 16 * 0, 16 * 0, mWidth, mHeight);
|
||||
mSprite->setAnimationFrames(0, 1, 16 * 0, 16 * 1, mWidth, mHeight);
|
||||
break;
|
||||
|
||||
case ITEM_POINTS_2_GAVINA:
|
||||
mSprite->setAnimationFrames(0, 0, 16 * 1, 16 * 0, mWidth, mHeight);
|
||||
mSprite->setAnimationFrames(0, 1, 16 * 1, 16 * 1, mWidth, mHeight);
|
||||
break;
|
||||
|
||||
case ITEM_POINTS_3_PACMAR:
|
||||
mSprite->setAnimationFrames(0, 0, 16 * 2, 16 * 0, mWidth, mHeight);
|
||||
mSprite->setAnimationFrames(0, 1, 16 * 2, 16 * 1, mWidth, mHeight);
|
||||
break;
|
||||
|
||||
case ITEM_CLOCK:
|
||||
mSprite->setAnimationFrames(0, 0, 16 * 3, 16 * 0, mWidth, mHeight);
|
||||
mSprite->setAnimationFrames(0, 1, 16 * 3, 16 * 1, mWidth, mHeight);
|
||||
break;
|
||||
case ITEM_TNT:
|
||||
mSprite->setAnimationFrames(0, 0, 16 * 4, 16 * 0, mWidth, mHeight);
|
||||
mSprite->setAnimationFrames(0, 1, 16 * 4, 16 * 1, mWidth, mHeight);
|
||||
break;
|
||||
|
||||
case ITEM_COFFEE:
|
||||
mSprite->setAnimationFrames(0, 0, 16 * 5, 16 * 0, mWidth, mHeight);
|
||||
mSprite->setAnimationFrames(0, 1, 16 * 5, 16 * 1, mWidth, mHeight);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -195,7 +197,7 @@ void Item::updateTimeToLive()
|
||||
{
|
||||
if (mTimeToLive > 0)
|
||||
{
|
||||
--mTimeToLive;
|
||||
mTimeToLive--;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -203,9 +205,7 @@ void Item::updateTimeToLive()
|
||||
void Item::checkTimeToLive()
|
||||
{
|
||||
if (mTimeToLive == 0)
|
||||
{
|
||||
erase();
|
||||
}
|
||||
}
|
||||
|
||||
// Obtiene del valor de la variable
|
||||
|
||||
Reference in New Issue
Block a user