Deux Ex Machina

This commit is contained in:
Bram Verhulst
2024-06-09 23:23:55 +02:00
parent 5f1dcd5788
commit caabb12838
17 changed files with 151 additions and 77 deletions

View File

@@ -0,0 +1,31 @@
#include "pch.h"
#include "GameOverScreen.h"
#include "colors.h"
#include "utils.h"
GameOverScreen::GameOverScreen(const std::string& filePath, Vector2f pos, Vector2f size, TextureManager* manager): Screen(filePath, pos, size, manager){
m_SkullTexture = manager->GetTexture("gui/gameover/skull.png");
GuiText* text = new GuiText(Vector2f{360, 150}, "Press Space To Quit", "fonts/Arial.ttf", 20, Colors::YELLOW);
AddElement(text);
}
GameOverScreen::~GameOverScreen() {
}
void GameOverScreen::Draw() const {
Screen::Draw();
//1230 x 1087
m_SkullTexture->Draw(Rectf{ 350, 200, 1230 / 5, 1087 / 5 });
}
void GameOverScreen::Update(float elapsedSecs) {
Screen::Update(elapsedSecs);
if(utils::isKeyDown(SDL_SCANCODE_SPACE)){
SDL_Event quitEvent;
quitEvent.type = SDL_QUIT;
SDL_PushEvent(&quitEvent);
}
}
void GameOverScreen::MarkDirty() {
}
void GameOverScreen::SellAll() {
}