static int showHighscore() { int key = getInputRaw(); renderHighscore(); if (points>highscore) { // Save highscore if higher highscore_set(points); } while(1) { key = getInputWait(); getInputWaitRelease(); if (key&BTN_DOWN) { return 1; } else if (key&BTN_UP) { return 0; } else if (key&BTN_RIGHT) { highscore = 0; highscore_set(highscore); setTextColor(0xff,0b00000011); DoString(RESX/2-4, RESY/2-2, IntToStr(highscore,6,0)); } renderHighscore(); } }
static bool gameover_scene() { int dy = getFontHeight(); int s1x = DoString(0, 0, "GAME OVER!"); s1x = (RESX-s1x)/2; int s2x = DoString(0, 0, "HIGHTSCORE!"); s2x = (RESX-s2x)/2; char key = 0; while(key != BTN_UP && key != BTN_DOWN) { lcdClear(); if(highscore_set(game.scroll_pos / 15, GLOBAL(nickname))) DoString (s2x, dy, "HIGHSCORE!"); else DoString(s1x, dy, "GAME OVER!"); int x = DoInt(0, 3*dy, game.scroll_pos / 15); DoChar(x, 3*dy, 'm'); DoString(0, 5*dy, "UP to play"); DoString(0, 6*dy, "DOWN to quit"); lcdDisplay(); key = getInputWaitTimeout(5000); } return !(key==BTN_DOWN); }
void ram() { char *nick = "Pentagon V1LLAG3"; char nickbuf[32]; // 16? do { lcdFill(0); DoString(0, 0, "Getting"); lcdDisplay(); uint32_t score = highscore_get(nickbuf); gpioSetValue (RB_LED2, 1); lcdFill(0); DoString(0, 0, "Highscore:"); DoString(0, 16, nickbuf); DoInt(0, 32, score); lcdDisplay(); if (strcmp(nick, nickbuf) != 0) { lcdFill(0); DoString(0, 48, "Setting"); lcdDisplay(); delayms_queue(500); highscore_set(score+1, nick); } } while(getInputWaitTimeout(500) != BTN_UP); }
static bool screen_gameover() { char key =0; while(key==0) { lcdFill(0); font = &Font_7x8; DoString (14,32, "GAME OVER"); DoInt (0,0, game.score); if (highscore_set(game.score, GLOBAL(nickname))) DoString (0,9,"HIGHSCORE!"); lcdDisplay(); key=getInputWaitTimeout(5000); } //getInputWaitRelease(); return !(key==BTN_LEFT); }
static void draw_splash(void){ char key=0; while(key==0) { lcdFill(0); if (highscore_set(game.score, GLOBAL(nickname))){ DoString (16,15,"HIGHSCORE!"); } else { DoString (16,15, "GAME OVER"); } DoString (24,40, "GAME BY"); DoString (10,50, "@RANZWERTIG"); lcdDisplay(); key=getInputWaitTimeout(1000); } return; }
static bool screen_gameover() { char key =0; while(key==0) { lcdFill(0x00); setIntFont(&Font_7x8); setTextColor(0x00,0b11100000); lcdSetCrsr(14+15,32+15);lcdPrint("GAME OVER"); setTextColor(0x00,0xff); lcdSetCrsr(0,0);lcdPrint(IntToStr(game.score,6,F_LONG)); if (highscore_set(game.score, GLOBAL(nickname))){ setTextColor(0x00,0b00011000); lcdSetCrsr(0,9);lcdPrint("HIGHSCORE!"); }; lcdDisplay(); key=getInputWaitTimeout(5000); } //getInputWaitRelease(); return !(key==BTN_LEFT); }
void ram() { for(int x = 63; x >= 0; x--) { lcdFill(0); DoString(x, 0, "Setting Highscore"); lcdDisplay(); } highscore_set(23542, "Pentagon V1LLAG3"); delayms_queue(500); for(int x = 63; x >= 0; x--) { lcdFill(0); DoString(x, 0, "Setting ..."); lcdDisplay(); } foo_set("PwnedPwnedPwnedPwnedPwnedPwned "); bar_set("http://chaosbay.camp.ccc.de/ "); delayms_queue(500); time_set(1313803870); }
static int showHighscore() { int key = getInputRaw(); //throw away pending keypress char nick[20]; uint32_t score = 0; highscore_set(points,GLOBAL(nickname)); score = highscore_get(nick); lcdClear(); setTextColor(0xff,0x00); DoString(0,RESY/2-33, " Your Score"); // Display own score in green color, if it's higher than high score, else red if (points > score) { setTextColor(0xff,0b00011100); } else { setTextColor(0xff,0b11100000); } DoString(RESX/2-4, RESY/2-25, IntToStr(points,6,0)); setTextColor(0xff,0x00); DoString(0,RESY/2-10, " Highscore"); setTextColor(0xff,0b11100000); DoString(RESX/2-4, RESY/2-2, IntToStr(score,6,0)); setTextColor(0xff,0x00); DoString(0, RESY/2+18, " UP to play "); DoString(0, RESY/2+26, "DOWN to quit "); lcdDisplay(); while(1) { key = getInputRaw(); if (key&BTN_DOWN) { return 1; } else if (key&BTN_UP) { return 0; } } }