#include "OverScreen.h" #include #include #include "Globals.h" #include "Stats.h" #include "TitleScreen.h" static constexpr const char* DIED {"The Bone is Gone"}; OverScreen::OverScreen(std::shared_ptr stats) : m_stats {stats} { const int screen_width = GetScreenWidth(); const int died_width = MeasureText(DIED, 20); m_died_x = (screen_width - died_width) / 2; m_flash.start(); } void OverScreen::update(const float dt) { m_flash.update(dt); if (IsKeyPressed(KEY_SPACE)) g_game.set(std::make_unique()); } void OverScreen::draw() { ClearBackground(BLACK); DrawText(DIED, m_died_x, 160, 20, RED); m_flash.draw(); }