forked from jaildesigner-jailgames/coffee_crisis
bugfix: player could fire and get items after death
This commit is contained in:
@@ -1569,20 +1569,6 @@ void GameDirector::updateDeath()
|
|||||||
// Renderiza el fade final cuando se acaba la partida
|
// Renderiza el fade final cuando se acaba la partida
|
||||||
void GameDirector::renderDeathFade()
|
void GameDirector::renderDeathFade()
|
||||||
{
|
{
|
||||||
/*if (!mPlayer->isAlive())
|
|
||||||
{
|
|
||||||
SDL_Rect rect = {0, 0, SCREEN_WIDTH, SCREEN_HEIGHT};
|
|
||||||
if (mGame.deathCounter < 256)
|
|
||||||
{
|
|
||||||
SDL_SetRenderDrawColor(mRenderer, 0x27, 0x27, 0x36, 255 - mGame.deathCounter);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
SDL_SetRenderDrawColor(mRenderer, 0x27, 0x27, 0x36, 0); // alpha - 0 trans, 255 opaco
|
|
||||||
}
|
|
||||||
SDL_RenderFillRect(mRenderer, &rect);
|
|
||||||
}*/
|
|
||||||
|
|
||||||
if (!mPlayer->isAlive() && (mGame.deathCounter < 150))
|
if (!mPlayer->isAlive() && (mGame.deathCounter < 150))
|
||||||
{
|
{
|
||||||
// 192 / 6 = 32, 6 cuadrados de 32 pixeles
|
// 192 / 6 = 32, 6 cuadrados de 32 pixeles
|
||||||
@@ -1798,6 +1784,7 @@ bool GameDirector::checkPlayerBallonCollision()
|
|||||||
// Comprueba la colisión entre el jugador y los items
|
// Comprueba la colisión entre el jugador y los items
|
||||||
void GameDirector::checkPlayerItemCollision()
|
void GameDirector::checkPlayerItemCollision()
|
||||||
{
|
{
|
||||||
|
if (mPlayer->isAlive())
|
||||||
for (Uint8 i = 0; i < MAX_ITEMS; i++)
|
for (Uint8 i = 0; i < MAX_ITEMS; i++)
|
||||||
{
|
{
|
||||||
if (mItem[i]->isEnabled())
|
if (mItem[i]->isEnabled())
|
||||||
@@ -2557,7 +2544,7 @@ void GameDirector::checkGameInput()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Modo Demo no activo
|
// Modo Demo no activo
|
||||||
else
|
else if (mPlayer->isAlive())
|
||||||
{
|
{
|
||||||
// Tecla izquierda o el mando hacia la izquierda
|
// Tecla izquierda o el mando hacia la izquierda
|
||||||
if ((keystates[mKeyboard.left] != 0) || (checkGameController(INPUT_LEFT)))
|
if ((keystates[mKeyboard.left] != 0) || (checkGameController(INPUT_LEFT)))
|
||||||
|
|||||||
Reference in New Issue
Block a user