Files
prog2/Game/Gui/Screens/GameOver/GameOverScreen.cpp
Bram Verhulst caabb12838 Deux Ex Machina
2024-06-09 23:23:55 +02:00

32 lines
889 B
C++

#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() {
}