#include <game_over.hpp>
◆ GameOver()
GameOver::GameOver |
( |
SDL_Renderer * | _renderer, |
|
|
TTF_Font * | font ) |
Constructor for the game_over class.
Initializes the game over screen with default values and sets up the back button
- Parameters
-
_renderer | The SDL renderer to use for drawing |
font | The TTF font to use for text display |
◆ ~GameOver()
Destructor for the game_over class.
Cleans up allocated resources
◆ action_handler()
bool GameOver::action_handler |
( |
const SDL_Event & | event | ) |
|
Handles user interaction events.
Processes SDL events to detect button clicks, particularly for the back button
- Parameters
-
event | The SDL event to process |
- Returns
- true if the back button is pressed, false otherwise
◆ get_go_back()
bool GameOver::get_go_back |
( |
| ) |
const |
◆ render_object()
void GameOver::render_object |
( |
| ) |
|
Renders the game over screen.
Displays the game over message, the winner's name, and the back button
◆ set_winner()
void GameOver::set_winner |
( |
const std::string & | name | ) |
|
Sets the winner's name to display on the game over screen.
- Parameters
-
name | The name of the winner to be displayed |
◆ button_back
SDL_Rect GameOver::button_back |
|
private |
Rectangle defining the back button's position and size
◆ go_back
Flag to indicate going back to the modes menu
◆ police
TTF_Font* GameOver::police |
|
private |
Font used for text rendering
◆ renderer
SDL_Renderer* GameOver::renderer |
|
private |
Responsible for placing the objects on the SDL screen
◆ texture_menu
SDL_Texture* GameOver::texture_menu |
|
private |
Texture for the menu background
◆ winner_name
std::string GameOver::winner_name |
|
private |
Name of the winning player to display
The documentation for this class was generated from the following files: