diff options
| author | fschildt <florian.schildt@protonmail.com> | 2025-10-06 09:25:04 +0200 | 
|---|---|---|
| committer | fschildt <florian.schildt@protonmail.com> | 2025-10-06 09:25:04 +0200 | 
| commit | 606d028dac5118329e7561af33b15988db84465f (patch) | |
| tree | 8a5b92b51a88714fee71d7f908283426f70b7dc1 /src/games/breakout | |
| parent | 7d9500d27fc91356c580e365351ff6e1bc1c95e1 (diff) | |
make everything prettier
Diffstat (limited to 'src/games/breakout')
| -rw-r--r-- | src/games/breakout/Breakout.cpp | 66 | ||||
| -rw-r--r-- | src/games/breakout/Breakout.hpp | 38 | 
2 files changed, 0 insertions, 104 deletions
diff --git a/src/games/breakout/Breakout.cpp b/src/games/breakout/Breakout.cpp deleted file mode 100644 index 65fafd6..0000000 --- a/src/games/breakout/Breakout.cpp +++ /dev/null @@ -1,66 +0,0 @@ -#include <games/breakout/Breakout.hpp> - -#include <imgui.h> - - -bool -Breakout::Update(std::vector<SDL_Event>& events) -{ -    for (auto& event : events) { -        if (m_status == pause) { -            ProcessEventDuringPause(event); -        } -        else { -            ProcessEventDuringResume(event); -        } -    } - -    if (m_status == pause) { -        DrawPauseMenu(); -    } -    if (m_status == exit) { -        return false; -    } - -    return true; -} - -void -Breakout::ProcessEventDuringResume(SDL_Event& event) -{ -    switch (event.type) { -    case SDL_EVENT_KEY_DOWN: { -        if (event.key.key == SDLK_ESCAPE) { -            m_status = pause; -        } -    } break; -    default:; -    } -} - -void -Breakout::ProcessEventDuringPause(SDL_Event &event) -{ -    switch (event.type) { -    case SDL_EVENT_KEY_DOWN: { -        if (event.key.key == SDLK_ESCAPE) { -            m_status = resume; -        } -    } break; -    default:; -    } -} - -void -Breakout::DrawPauseMenu() -{ -    ImGui::Begin("BreakoutPause"); -    if (ImGui::Button("Resume")) { -        m_status = resume; -    } -    if (ImGui::Button("Exit")) { -        m_status = exit; -    } -    ImGui::End(); -} - diff --git a/src/games/breakout/Breakout.hpp b/src/games/breakout/Breakout.hpp deleted file mode 100644 index 9f2a0ef..0000000 --- a/src/games/breakout/Breakout.hpp +++ /dev/null @@ -1,38 +0,0 @@ -#pragma once - -#include <common/math.hpp> -#include <common/shapes.hpp> -#include <games/Game.hpp> - - -struct Ball { -    V3F32 pos; -    float radius; -}; - - -class Breakout : public Game { -    enum GameStatus { -        resume, -        pause, -        exit -    }; - -public: -    Breakout() = default; -    bool Update(std::vector<SDL_Event> &events) override; - -private: -    void ProcessEventDuringPause(SDL_Event& event); -    void ProcessEventDuringResume(SDL_Event& event); - -    void Draw(); -    void DrawPauseMenu(); -     - -private: -    GameStatus m_status; - -    Circle m_circle; -}; -  | 
