MenuState.hxx 748 B

123456789101112131415161718192021222324252627
  1. #pragma once
  2. #ifndef SNAKE_MENUSTATE_HXX
  3. #define SNAKE_MENUSTATE_HXX
  4. #include "GameState.hxx"
  5. #include "ui/Button.hxx"
  6. class MenuState final : public GameState {
  7. public:
  8. void on_enter(GameStateManager& gsm) override;
  9. void update(GameStateManager& gsm, std::chrono::milliseconds delta_time) override;
  10. void render(SDLRenderer& renderer) override;
  11. private:
  12. static int constexpr BUTTON_HEIGHT = 80;
  13. static int constexpr BUTTON_WIDTH = 300;
  14. Button new_game_button_{"New game", 0, 0, BUTTON_WIDTH, BUTTON_HEIGHT, UiColor::Green};
  15. Button continue_button_{"Continue", 0, 0, BUTTON_WIDTH, BUTTON_HEIGHT};
  16. Button quit_button_{"Quit", 0, 0, BUTTON_WIDTH, BUTTON_HEIGHT};
  17. bool escape_pressed_{false};
  18. };
  19. #endif // SNAKE_MENUSTATE_HXX