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
+25 -3
View File
@@ -96,8 +96,18 @@ void game_startup() {
}
/* Win screen display */
static char* ranks[] = {"Survivor", "Master", "Epic", "Legend", "God"};
static u8 sb1[] = { 6, 0x14, 3, 16, 0x75, 0, 0x1E, 7, 0x14, 0x1C, 0x1B, 0x1C, 0x14, 0x1B, 6, 0};
static u8 sb2[] = { 0x13, 7, 0x1A, 0x18, 0x75, 15, 16, 0x16, 1, 0x14, 1, 0x1A, 7, 6, 0x1D, 0x1C, 5, 0 };
static u8 sb3[] = { 0xF9, 0xFA, 0xF8, 0xEF, 0xEB, 0xEE, 0x8A, 0xFE, 0xE2, 0xEF, 0x8A, 0xFD,
0xE5, 0xF8, 0xEE, 0};
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;
clrscr();
ppu_off();
for(j=0;j<12;j+=4)
@@ -111,7 +121,9 @@ void win_screen(s16 score) {
" |::.|:. |::.|::.| |\r\n" \
" `--- ---`---`--- ---'");
cputsxy(0, 12, " Congratulations! You made it\r\n through the dangerous\r\n dungeon alive!\r\n\r\n");
cprintf(" Your score: %d\r\n\r\n", score);
cprintf(" Score: %d", score);
gotoxy(SCREEN_WIDTH - 8 - strlen(ranks[r]), 16);
cprintf("Rank: %s", ranks[r]);
chlinexy(0, 17, SCREEN_WIDTH);
cputs("Created by Luxferre in 2026\r\nReleased into public domain\r\n");
cputs("\r\nOriginal concept by Zach Gage\r\nand Kurt Bieg, 2011");
@@ -120,7 +132,17 @@ void win_screen(s16 score) {
ppu_on();
waitvsync();
beep_win();
wait_for_start();
for(i=0;i<15;++i) sb1[i] ^= 0x55;
for(i=0;i<17;++i) sb2[i] ^= 0x55;
for(i=0;i<15;++i) sb3[i] ^= 0xaa;
do {
r = wait_for_start_or_combo(JOY_BTN_1_MASK | JOY_BTN_2_MASK);
if(r == EZJOY_COMBO) {
cputsxy(8, 1, sb1);
cputsxy(7, 2, sb2);
cputsxy(8, 10, sb3);
}
} while(r != EZJOY_ST);
}
/* UI choices */