- [NEW] Pantalla de game over

- [NEW] Stats
This commit is contained in:
2024-07-24 23:05:24 +02:00
parent 3a51938d80
commit 0a1b4f8715
8 changed files with 165 additions and 15 deletions

56
source/m_gameover.cpp Normal file
View File

@@ -0,0 +1,56 @@
#include "m_gameover.h"
#include "jgame.h"
#include "jinput.h"
#include "jdraw.h"
#include "actor.h"
#include "room.h"
#include "config.h"
#include <SDL2/SDL.h>
namespace modules
{
namespace gameover
{
actor::actor_t *heroi = nullptr;
int selected_option = GAMEOVER_CONTINUAR;
void init()
{
if (heroi == nullptr) heroi = actor::create("HERO", {16,32,8}, {6,6,12}, "test.gif", {0,32,20,32}, {-6,38});
heroi->flags = FLAG_ANIMATED;
}
int loop()
{
if (input::keyPressed(SDL_SCANCODE_SPACE)) {
return false;
}
draw::cls(2);
draw::color(1);
draw::swapcol(1, WHITE);
actor::update(heroi, false);
actor::drawAt(heroi, 150, 160);
draw::print2("THE POOL", 16, 3, TEAL, FONT_ZOOM_VERTICAL);
draw::print2("GAME OVER", 15, 7, YELLOW, FONT_ZOOM_VERTICAL);
draw::print2(actor::stats::getNumPartsCollected(), 2, 11, 12, GREEN, FONT_ZOOM_NONE);
draw::print2("PARTS TROBADES", 14, 12, GREEN, FONT_ZOOM_NONE);
draw::print2(actor::stats::getRoomsVisited(), 2, 8, 14, GREEN, FONT_ZOOM_NONE);
draw::print2("HABITACIONS VISITADES", 11, 14, GREEN, FONT_ZOOM_NONE);
draw::print2(actor::stats::getLivesLost(), 2, 11, 16, GREEN, FONT_ZOOM_NONE);
draw::print2("VIDES PERDUDES", 14, 16, GREEN, FONT_ZOOM_NONE);
draw::print2("(C) JAILDOCTOR 2024", 11, 28, TEAL, FONT_ZOOM_NONE);
draw::render();
return true;
}
}
}