Operation Null Mind 0.4.1
A 2D roguelike top down shooter game made with SDL2
 
Loading...
Searching...
No Matches
death_layout.c File Reference

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
 

Detailed Description

Implements the death screen.

Manages the death screen UI layout, button interactions, and transitions between game and pause states.

Author
Darren
Date
2025-03-28

Function Documentation

◆ Death_Render()

void Death_Render ( )

[Render] Draws the death screen to the screen

Renders the death screen.

Renders the death screen UI elements

◆ Death_Start()

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.

◆ Death_Update()

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

◆ EndScreen_CreateStatsPanel()

int EndScreen_CreateStatsPanel ( const char *  titleText,
int  startY,
int  bodyX,
int  valueX 
)

Creates the statistics panel UI elements.

Parameters
titleTextThe text to display in the statistics header (e.g., "Statistics")
startYThe Y position to start rendering the statistics panel
bodyXThe X position for labels
valueXThe X position for values (right-aligned)
Returns
The Y position after the last statistic row

◆ EndScreen_RenderStatsPanel()

void EndScreen_RenderStatsPanel ( SDL_Rect  headerRect)

Renders the statistics panel.

Parameters
headerRectThe rectangle for the statistics header background

◆ EndScreen_UpdateStats()

void EndScreen_UpdateStats ( int  floorValue,
int  timeValue,
int  robotsValue,
int  healingValue,
int  hitsValue,
int  ammoValue 
)

Updates the statistics values on the end screen.

Parameters
floorValueThe floor/level reached by the player
timeValueThe time in seconds the run lasted
robotsValueThe number of robots deactivated during the run
healingValueThe number of healing items used during the run
hitsValueThe number of hits taken by the player
ammoValueThe amount of ammunition spent during the run