The NEW Pong Game V13.2.1
An interesting implemnettaion of the pong game
Loading...
Searching...
No Matches
page_3b_0t.hpp
Go to the documentation of this file.
1
8#ifndef MENU_HPP
9#define MENU_HPP
10
11#include <SDL.h>
12#include <SDL_ttf.h>
13#include <array>
14#include <string>
15#include <functional>
16#include <SDL_mixer.h>
17
18#include "game_save.hpp"
19
28{
29private:
31 bool exit_mode;
36 SDL_Texture *texture_menu;
37 SDL_Renderer *renderer;
38 TTF_Font *police;
40 SDL_Rect button_start;
41 SDL_Rect button_exit;
42 SDL_Rect button_continue;
44public:
50 page_3b_0t(SDL_Renderer *_renderer, TTF_Font *font);
51
56
62 bool action_handler(const SDL_Event &event);
63
70 void render_object(int mode, const std::string &highscore_name, int highscore);
71
76 bool get_started() const { return start_new_game; }
77
82 bool get_exit_mode() const { return exit_mode; }
83
89
94 bool get_continue_game() const { return continue_game; }
95
100};
101
102#endif
static bool save_exists()
Checks if a save file exists.
Definition game_save.cpp:268
Main menu class with 3 buttons and no title.
Definition page_3b_0t.hpp:28
SDL_Rect button_continue
Definition page_3b_0t.hpp:42
bool get_started() const
Checks if the start new game button was pressed.
Definition page_3b_0t.hpp:76
SDL_Rect button_start
Definition page_3b_0t.hpp:40
void render_object(int mode, const std::string &highscore_name, int highscore)
Renders the main menu.
Definition page_3b_0t.cpp:114
page_3b_0t(SDL_Renderer *_renderer, TTF_Font *font)
Constructor for the main menu page.
Definition page_3b_0t.cpp:24
SDL_Renderer * renderer
Definition page_3b_0t.hpp:37
bool start_new_game
Definition page_3b_0t.hpp:30
bool get_continue_game() const
Checks if the continue game button was pressed.
Definition page_3b_0t.hpp:94
bool get_exit_mode() const
Checks if the exit button was pressed.
Definition page_3b_0t.hpp:82
SDL_Rect button_exit
Definition page_3b_0t.hpp:41
SDL_Texture * texture_menu
Definition page_3b_0t.hpp:36
~page_3b_0t()
Destructor for the main menu page.
Definition page_3b_0t.cpp:45
bool continue_game
Definition page_3b_0t.hpp:32
void set_saved_file_exists()
Updates the saved file exists flag.
Definition page_3b_0t.hpp:99
bool exit_mode
Definition page_3b_0t.hpp:31
bool saved_file_exists
Definition page_3b_0t.hpp:34
bool get_saved_file_exists() const
Checks if a saved game file exists.
Definition page_3b_0t.hpp:88
bool action_handler(const SDL_Event &event)
Handles events for the menu buttons.
Definition page_3b_0t.cpp:63
TTF_Font * police
Definition page_3b_0t.hpp:38
Header defining the save game and highscore functionaloty from the Saving class.
TTF_Font * font
Definition letter_test.cpp:24