summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/plugins/chopper.c46
1 files changed, 20 insertions, 26 deletions
diff --git a/apps/plugins/chopper.c b/apps/plugins/chopper.c
index 7a7316e00d..08124681fb 100644
--- a/apps/plugins/chopper.c
+++ b/apps/plugins/chopper.c
@@ -49,7 +49,8 @@ PLUGIN_HEADER
49#elif CONFIG_KEYPAD == IAUDIO_X5_PAD /* grayscale at the moment */ 49#elif CONFIG_KEYPAD == IAUDIO_X5_PAD /* grayscale at the moment */
50 50
51#define QUIT BUTTON_POWER 51#define QUIT BUTTON_POWER
52#define ACTION BUTTON_SELECT 52#define ACTION BUTTON_UP
53#define ACTION2 BUTTON_SELECT
53#define ACTIONTEXT "SELECT" 54#define ACTIONTEXT "SELECT"
54 55
55#elif CONFIG_KEYPAD == IRIVER_H10_PAD 56#elif CONFIG_KEYPAD == IRIVER_H10_PAD
@@ -73,8 +74,9 @@ PLUGIN_HEADER
73#define ACTIONTEXT "PLAY" 74#define ACTIONTEXT "PLAY"
74 75
75#elif CONFIG_KEYPAD == ONDIO_PAD 76#elif CONFIG_KEYPAD == ONDIO_PAD
76#define QUIT BUTTON_MENU 77#define QUIT BUTTON_OFF
77#define ACTION BUTTON_RIGHT 78#define ACTION BUTTON_UP
79#define ACTION BUTTON_MENU
78#define ACTIONTEXT "RIGHT" 80#define ACTIONTEXT "RIGHT"
79 81
80#else 82#else
@@ -387,7 +389,6 @@ static void chopAddParticle(int x,int y,int sx,int sy)
387 mParticles[i].iWorldY = y; 389 mParticles[i].iWorldY = y;
388 mParticles[i].iSpeedX = sx; 390 mParticles[i].iSpeedX = sx;
389 mParticles[i].iSpeedY = sy; 391 mParticles[i].iSpeedY = sy;
390
391} 392}
392 393
393static void chopGenerateBlockIfNeeded(void) 394static void chopGenerateBlockIfNeeded(void)
@@ -458,19 +459,6 @@ static int chopParticleOffscreen(struct CParticle *mParticle)
458 return 0; 459 return 0;
459} 460}
460 461
461static void checkHighScore(void)
462{
463 if (score > highscore) {
464 char scoretext[30];
465 int w;
466 highscore = score;
467 rb->snprintf(scoretext, sizeof(scoretext), "New High Score: %d",
468 highscore);
469 rb->lcd_getstringsize(scoretext, &w, NULL);
470 rb->lcd_putsxy(LCD_WIDTH/2 - w/2 ,LCD_HEIGHT/2 + 20, scoretext);
471 }
472}
473
474static void chopKillPlayer(void) 462static void chopKillPlayer(void)
475{ 463{
476 int w, i, button; 464 int w, i, button;
@@ -486,21 +474,24 @@ static void chopKillPlayer(void)
486 if (iPlayerAlive == 0) { 474 if (iPlayerAlive == 0) {
487 rb->lcd_set_drawmode(DRMODE_FG); 475 rb->lcd_set_drawmode(DRMODE_FG);
488#if LCD_DEPTH >= 2 476#if LCD_DEPTH >= 2
489 rb->lcd_set_foreground(LCD_WHITE); 477 rb->lcd_set_foreground(LCD_LIGHTGRAY);
490#endif 478#endif
491 checkHighScore(); 479 rb->splash(HZ, true, "Game Over");
480
481 if (score > highscore) {
482 char scoretext[30];
483 int w;
484 highscore = score;
485 rb->snprintf(scoretext, sizeof(scoretext), "New High Score: %d",
486 highscore);
487 rb->splash(HZ*2, true, scoretext);
488 }
492 489
493 rb->lcd_getstringsize("Game Over", &w, NULL); 490 rb->splash(HZ/4, true, "Press " ACTIONTEXT " to continue");
494 rb->lcd_putsxy(LCD_WIDTH/2 - w/2 ,LCD_HEIGHT/2 - 20, "Game Over");
495 rb->lcd_getstringsize("Press " ACTIONTEXT " to continue", &w, NULL);
496 rb->lcd_putsxy(LCD_WIDTH/2 - w/2 ,LCD_HEIGHT/2,
497 "Press " ACTIONTEXT " to continue");
498 rb->lcd_update(); 491 rb->lcd_update();
499 492
500 rb->lcd_set_drawmode(DRMODE_SOLID); 493 rb->lcd_set_drawmode(DRMODE_SOLID);
501 494
502 rb->sleep(HZ * 0.5);
503
504 while (true) { 495 while (true) {
505 button = rb->button_get(true); 496 button = rb->button_get(true);
506 if (button == ACTION 497 if (button == ACTION
@@ -631,6 +622,9 @@ static int chopMenu(int menunum)
631#if HAVE_LCD_COLOR 622#if HAVE_LCD_COLOR
632 rb->lcd_set_foreground(LCD_WHITE); 623 rb->lcd_set_foreground(LCD_WHITE);
633 rb->lcd_set_background(LCD_BLACK); 624 rb->lcd_set_background(LCD_BLACK);
625#elif LCD_DEPTH == 2
626 rb->lcd_set_foreground(LCD_BLACK);
627 rb->lcd_set_background(LCD_WHITE);
634#endif 628#endif
635 629
636 rb->lcd_clear_display(); 630 rb->lcd_clear_display();