Deux Ex Machina
This commit is contained in:
31
Game/Gui/Screens/GameOver/GameOverScreen.cpp
Normal file
31
Game/Gui/Screens/GameOver/GameOverScreen.cpp
Normal 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() {
|
||||
}
|
||||
Reference in New Issue
Block a user