The NEW Pong Game  V13.2.1
An interesting implemnettaion of the pong game
page_4b_1t.hpp
Go to the documentation of this file.
1 
8 #ifndef MODE_MENU_HPP
9 #define MODE_MENU_HPP
10 
11 #include <SDL.h>
12 #include <SDL_ttf.h>
13 #include <SDL_mixer.h>
14 #include <array>
15 
24 {
25 private:
26  int mode_id;
27  bool exit_game;
37  SDL_Texture *texture_menu;
38  SDL_Renderer *renderer;
39  TTF_Font *police;
41  SDL_Rect button_ai_mode;
44  SDL_Rect button_fun_mode;
45  SDL_Rect button_exit;
47 public:
53  page_4b_1t(SDL_Renderer *_renderer, TTF_Font *font);
54 
58  ~page_4b_1t();
59 
65  bool action_handler(const SDL_Event &event);
66 
70  void render_object();
71 
76  bool get_exit_game() const { return exit_game; }
77 
82  int get_mode_id() const { return mode_id; }
83 };
84 
85 #endif
Defines the mode selection menu with 4 buttons and 1 title.
Definition: page_4b_1t.hpp:24
bool action_handler(const SDL_Event &event)
Handles events for the menu buttons.
Definition: page_4b_1t.cpp:71
SDL_Rect button_two_players_mode
Definition: page_4b_1t.hpp:42
SDL_Rect button_storytime_mode
Definition: page_4b_1t.hpp:43
SDL_Rect button_fun_mode
Definition: page_4b_1t.hpp:44
bool get_exit_game() const
Checks if the exit game flag is set.
Definition: page_4b_1t.hpp:76
bool exit_game
Definition: page_4b_1t.hpp:27
TTF_Font * police
Definition: page_4b_1t.hpp:39
SDL_Rect button_exit
Definition: page_4b_1t.hpp:45
page_4b_1t(SDL_Renderer *_renderer, TTF_Font *font)
Constructor for the mode menu page.
Definition: page_4b_1t.cpp:25
int get_mode_id() const
Gets the selected game mode ID.
Definition: page_4b_1t.hpp:82
SDL_Texture * texture_menu
Definition: page_4b_1t.hpp:37
int mode_id
Definition: page_4b_1t.hpp:26
SDL_Renderer * renderer
Definition: page_4b_1t.hpp:38
void render_object()
Renders the mode menu.
Definition: page_4b_1t.cpp:123
~page_4b_1t()
Destructor for the mode menu page.
Definition: page_4b_1t.cpp:54
SDL_Rect button_ai_mode
Definition: page_4b_1t.hpp:41
TTF_Font * font
Definition: letter_test.cpp:24