added ranks to nes/gb versions

This commit is contained in:
Luxferre
2026-01-27 11:46:59 +02:00
parent 69c3f46640
commit 833c57631b
3 changed files with 57 additions and 14 deletions
+14 -11
View File
@@ -89,8 +89,14 @@ void game_startup() {
}
/* Win screen display */
static char* ranks[] = {"Survivor", "Master", "Epic", "Legend", "God"};
void win_screen(s16 score) {
u8 i, j;
u8 i, j, r;
if(score > 29) r = 4;
else if(score > 24) r = 3;
else if(score > 19) r = 2;
else if(score > 9) r = 1;
else r = 0;
termreset();
cputs( \
" \x1d \x1c \x0e\x0e\x0e \x1c \x1c" NL
@@ -102,9 +108,10 @@ void win_screen(s16 score) {
cputsxy(0, 7, " You made it across");
cputsxy(0, 8, " the dangerous");
cputsxy(0, 9, " dungeon alive!");
gotoxy(0, 11);
cprintf(" Your score: ");
printnum(score);
gotoxy(1, 11);
cprintf("Score: %d", score);
gotoxy(SCREEN_WIDTH-3-strlen(ranks[r]), 11);
cprintf("|%s|", ranks[r]);
chlinexy(0, 12, SCREEN_WIDTH);
cputs(" By: Luxferre, 2026");
cputs(NL NL " Orig: Zach Gage," NL " Kurt Bieg, 2011");
@@ -184,13 +191,9 @@ void render_room_item(u8 i, u8 v) {
rect(topleft_x, topleft_y, cwidth, cheight);
gotoxy(topleft_x + 1, topleft_y + 1);
/* draw text */
if(v < 14) {
cputs("ENMY");
} else if(v < 23) {
cputs("WEAP");
} else {
cputs("POTI");
}
if(v < 14) cputs("ENMY");
else if(v < 23) cputs("WEAP");
else cputs("POTI");
gotoxy(topleft_x + 2, topleft_y + 2);
if(v < 14) printnum(v + 1);
else if(v < 23) printnum(v - 12);