From 85970ffe0ab430aaf6d9cd6d591d53188f6cd02b Mon Sep 17 00:00:00 2001 From: Luxferre Date: Thu, 8 Jan 2026 18:14:00 +0200 Subject: [PATCH] updated NES UI a bit --- nes/nescoundrel.c | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/nes/nescoundrel.c b/nes/nescoundrel.c index 9471506..e6844ab 100644 --- a/nes/nescoundrel.c +++ b/nes/nescoundrel.c @@ -211,7 +211,7 @@ void render_room_item(short i, short v) { /* Render main game screen */ void render_main_scene() { - short i, deck_count = 0, statbase = SCREEN_WIDTH - 7; + short i, deck_count = 0, statbase = 18; short room_start_x = 1, room_start_y = 1, room_end_x = statbase - 8, @@ -233,26 +233,25 @@ void render_main_scene() { for(i=0;i<4;i++) render_room_item(i, room[i]); cputsxy(11, 12, "ROOM"); /* render stats */ - gotoxy(statbase, 1); - cprintf("HP %02d", hp); - gotoxy(statbase, 2); - cprintf("ATK %02d", weapon); - gotoxy(statbase, 3); - cprintf("DUR %02d", durability); - gotoxy(statbase, 4); - chline(6); gotoxy(statbase, 5); - cprintf("DCK %02d", deck_count); + cprintf("Health %02d", hp); gotoxy(statbase, 6); - cprintf("RMS %02d", rooms_cleared); + cprintf("Weapon %02d", weapon); gotoxy(statbase, 7); - chline(6); + cprintf("Durability %02d", durability); + gotoxy(statbase, 17); + cprintf("Deck cards %02d", deck_count); + gotoxy(statbase, 19); + cprintf("Rooms clrd %02d", rooms_cleared); /* render controls info */ if(can_run) { - cputsxy(statbase, 10, "Run:"); - cputsxy(statbase, 12, "A/B or"); - cputsxy(statbase, 14, "SELECT"); + cputsxy(25, 10, "Run:"); + cputsxy(25, 12, "A/B or"); + cputsxy(25, 14, "SELECT"); + } else { + cputsxy(25, 11, "Cannot"); + cputsxy(25, 13, " run!"); } /* render status message */ gotoxy(1, SCREEN_HEIGHT-2); @@ -432,7 +431,7 @@ int game() { can_run = 0; /* can't run twice in a row */ engaged = 0; last_room = 0; /* Since we added cards, it's not the last room anymore */ - + print_msg("You ran from the room."); } else { /* engagement mechanics */ engaged++; /* increase the amount of engaged cards */ can_run = 0; /* Cannot run once engaged */