rogged: re-seed on game-over; display seed in game-end screen

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I0178392036902a87b64fde63f5a5f56a6a6a6964
This commit is contained in:
raf 2026-04-10 11:22:17 +03:00
commit 8bbca55b78
Signed by: NotAShelf
GPG key ID: 29D95B64378DB4BF
3 changed files with 16 additions and 8 deletions

View file

@ -507,7 +507,7 @@ void render_floating_texts(FloatingText *texts, int count, int shake_x, int shak
}
void render_end_screen(int is_victory, int kills, int items, int damage_dealt, int damage_taken, int crits,
int times_hit, int potions, int floors, int turns, int score) {
int times_hit, int potions, int floors, int turns, int score, unsigned int seed) {
// Semi-transparent overlay
Rectangle overlay = {0, 0, (float)SCREEN_WIDTH, (float)SCREEN_HEIGHT};
DrawRectangleRec(overlay, (Color){0, 0, 0, 210});
@ -523,7 +523,7 @@ void render_end_screen(int is_victory, int kills, int items, int damage_dealt, i
int box_x = SCREEN_WIDTH / 2 - 200;
int box_y = 110;
int box_w = 400;
int box_h = 320;
int box_h = 350;
DrawRectangle(box_x, box_y, box_w, box_h, (Color){20, 20, 20, 240});
DrawRectangleLines(box_x, box_y, box_w, box_h, (Color){100, 100, 100, 255});
@ -589,7 +589,14 @@ void render_end_screen(int is_victory, int kills, int items, int damage_dealt, i
DrawText("SCORE:", col1_x, row_y, 22, GOLD);
snprintf(line, sizeof(line), "%d", score);
DrawText(line, col1_x + 90, row_y, 22, GOLD);
row_y += 35;
// Seed display
DrawText("SEED:", col1_x, row_y, 18, label_color);
snprintf(line, sizeof(line), "%u", seed);
DrawText(line, col1_x + 60, row_y, 18, END_SEED);
// Instructions
if (is_victory) {
const char *subtitle = "Press R to play again or Q to quit";
int sub_width = MeasureText(subtitle, 20);