Implements the death screen. More...
#include <death.h>#include <UI_text.h>#include <input.h>#include <app.h>#include <sound.h>#include <game.h>#include <stdio.h>Functions | |
| void | EndScreen_UpdateStats (int floorValue, int timeValue, int robotsValue, int healingValue, int hitsValue, int ammoValue) |
| Updates the statistics values on the end screen. | |
| int | EndScreen_CreateStatsPanel (const char *titleText, int startY, int bodyX, int valueX) |
| Creates the statistics panel UI elements. | |
| void | EndScreen_RenderStatsPanel (SDL_Rect headerRect) |
| Renders the statistics panel. | |
| void | Death_Start () |
| [Start] Initializes the death screen UI elements | |
| void | Death_Update () |
| [PostUpdate] Processes user input for the death screen | |
| void | Death_Render () |
| [Render] Draws the death screen to the screen | |
Implements the death screen.
Manages the death screen UI layout, button interactions, and transitions between game and pause states.
| void Death_Render | ( | ) |
[Render] Draws the death screen to the screen
Renders the death screen.
Renders the death screen UI elements
| void Death_Start | ( | ) |
[Start] Initializes the death screen UI elements
Initializes the death screen.
Creates the text elements that make up the death screen, positioning them appropriately on the screen.
| void Death_Update | ( | ) |
[PostUpdate] Processes user input for the death screen
Updates the death screen state.
Checks for the ESC key press or button clicks to return to the main menu and updates the statistics display
| int EndScreen_CreateStatsPanel | ( | const char * | titleText, |
| int | startY, | ||
| int | bodyX, | ||
| int | valueX | ||
| ) |
Creates the statistics panel UI elements.
| titleText | The text to display in the statistics header (e.g., "Statistics") |
| startY | The Y position to start rendering the statistics panel |
| bodyX | The X position for labels |
| valueX | The X position for values (right-aligned) |
| void EndScreen_RenderStatsPanel | ( | SDL_Rect | headerRect | ) |
Renders the statistics panel.
| headerRect | The rectangle for the statistics header background |
| void EndScreen_UpdateStats | ( | int | floorValue, |
| int | timeValue, | ||
| int | robotsValue, | ||
| int | healingValue, | ||
| int | hitsValue, | ||
| int | ammoValue | ||
| ) |
Updates the statistics values on the end screen.
| floorValue | The floor/level reached by the player |
| timeValue | The time in seconds the run lasted |
| robotsValue | The number of robots deactivated during the run |
| healingValue | The number of healing items used during the run |
| hitsValue | The number of hits taken by the player |
| ammoValue | The amount of ammunition spent during the run |