X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Fgamescr.c;h=11390c7dce6931a9125ce66a475b4fd0ef252470;hb=fb23aa4804a46173f817eb83b4823b7263ef0ed9;hp=62c16a9e39436ec19e6d413a223c5f6e19e9cd6d;hpb=797884e55a370ff38e244375cc503e97b6355222;p=gbajam22 diff --git a/src/gamescr.c b/src/gamescr.c index 62c16a9..11390c7 100644 --- a/src/gamescr.c +++ b/src/gamescr.c @@ -109,8 +109,6 @@ static void setup_palette(void) int i; unsigned char *cmap = gba_colors ? color_gba_cmap : color_cmap; - emuprint("setting up %s palette", gba_colors ? "GBA" : "NDS/Emu"); - for(i=0; i<256; i++) { int r = cmap[i * 3]; int g = cmap[i * 3 + 1]; @@ -145,7 +143,7 @@ static int gamescr_start(void) /* setup color image palette */ setup_palette(); - spr_setup(16, 16, spr_game_pixels, spr_game_cmap); + spr_setup(16, 16, spr_game_pixels, gba_colors ? spr_game_gba_cmap : spr_game_cmap); wait_vblank(); spr_clear(); @@ -555,8 +553,20 @@ static void draw(void) static void victory(void) { + int sec, time_bonus = 0; + total_time = timer_msec - start_time; - score = 42; + sec = total_time / 1000; + + if(sec < 60) { + time_bonus = 1000 + (60 - sec) * 100; + } else if(sec < 120) { + time_bonus = 250 + (60 - (sec - 60)) * 10; + } else if(sec < 300) { + time_bonus = 100; + } + + score = energy * 250 + time_bonus; /* TODO enter name */ save_score("???", score, total_time, 0);