added player2 gfx

This commit is contained in:
2021-08-22 09:41:17 +02:00
parent 837306f16e
commit e793e08e85
11 changed files with 40 additions and 9 deletions

View File

@@ -1831,6 +1831,7 @@ void Game::popBalloon(Uint8 index)
case POWER_BALL:
destroyAllBalloons();
mPowerBallEnabled = false;
mEnemyDeployCounter = 20;
break;
// En cualquier otro caso, crea dos globos de un tipo inferior
@@ -2022,6 +2023,10 @@ void Game::checkPlayerItemCollision()
mPlayer->giveExtraHit();
JA_PlaySound(mSoundItemPickup);
break;
case ITEM_COFFEE_MACHINE:
mPlayer->setPowerUp(true);
JA_PlaySound(mSoundItemPickup);
break;
default:
break;
@@ -2130,10 +2135,13 @@ void Game::resetItems()
// Devuelve un item en función del azar
Uint8 Game::dropItem()
{
//return ITEM_COFFEE;
if (mPlayer->isPowerUp())
return NO_KIND;
else
return ITEM_COFFEE_MACHINE;
const Uint8 luckyNumber = rand() % 99;
const Uint8 item = rand() % 5;
const Uint8 item = rand() % 6;
switch (item)
{
@@ -2157,6 +2165,10 @@ Uint8 Game::dropItem()
if (luckyNumber < 5)
return ITEM_COFFEE;
break;
case 5:
if (luckyNumber < 4)
return ITEM_COFFEE_MACHINE;
break;
default:
break;
}