diff --git a/apps/recorder/sokoban.c b/apps/recorder/sokoban.c index ff3f13fe13..7e3ee0cdbb 100644 --- a/apps/recorder/sokoban.c +++ b/apps/recorder/sokoban.c @@ -31,7 +31,7 @@ #define SOKOBAN_TITLE "Sokoban" #define SOKOBAN_TITLE_FONT 2 -#define NUM_LEVELS 4 +#define NUM_LEVELS 25 int board[16][20]; int current_level=0; @@ -110,24 +110,374 @@ int levels[320*NUM_LEVELS] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -/* level 40 +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +/* level 05 */ +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,2,2,2,2,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,2,5,1,2,2,2,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,2,1,4,1,1,2,0,0,0,0,0,0,0, +0,0,0,0,0,0,2,2,2,1,2,1,2,2,0,0,0,0,0,0, +0,0,0,0,0,0,2,3,2,1,2,1,1,2,0,0,0,0,0,0, +0,0,0,0,0,0,2,3,4,1,1,2,1,2,0,0,0,0,0,0, +0,0,0,0,0,0,2,3,1,1,1,4,1,2,0,0,0,0,0,0, +0,0,0,0,0,0,2,2,2,2,2,2,2,2,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0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0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,2,2,2,2,2,2,2,2,0,0,0,0, +0,0,0,0,0,2,2,2,2,1,1,1,1,3,1,2,0,0,0,0, +0,0,0,0,0,2,1,1,4,1,4,1,4,3,1,2,0,0,0,0, +0,0,0,0,0,2,1,1,3,2,2,2,2,3,2,2,0,0,0,0, +0,0,0,0,0,2,1,4,3,4,1,4,1,5,2,0,0,0,0,0, +0,0,0,0,0,2,1,1,3,1,1,1,1,2,2,0,0,0,0,0, +0,0,0,0,0,2,2,2,2,2,2,2,2,2,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +/* level 26 */ + +/* level 27 */ + +/* level 28 */ + +/* level 29 */ + +/* level 30 */ + }; @@ -137,6 +487,7 @@ void load_level(int level_to_load) { int b = 0; int c = 0; + boxes_to_go = 0; /* load level into board */ /* get to the current level in the level array */ a = level_to_load*320; @@ -238,11 +589,34 @@ void sokoban_loop(void) { } - if ( b & BUTTON_F1 ) { - /* get out of here */ + if ( b & BUTTON_F3 ) { + /* increase level */ boxes_to_go=0; } + if ( b & BUTTON_F2 ) { + /* same level */ + load_level(current_level); + lcd_clear_display(); + update_screen(); + moves=0; + + } + + if ( b & BUTTON_F1 ) { + /* previous level */ + if (current_level==0) { + current_level=0; + } + else { + current_level--; + } + load_level(current_level); + lcd_clear_display(); + update_screen(); + moves=0; + } + if ( b & BUTTON_LEFT ) { /* if it is a blank spot */ if (board[row][col-1]==1) { @@ -528,17 +902,18 @@ void sokoban_loop(void) { update_screen(); } + + if (boxes_to_go==0) { moves=0; current_level++; if (current_level == NUM_LEVELS) { - lcd_clear_display(); - lcd_putsxy(10, 20, "YOU WIN!!", 2); - - lcd_update(); - for (ii=0 ; ii<20 ; ii++) { - lcd_invertrect(0,0,111,63); + for(ii=0; ii<30 ; ii++) { + lcd_clear_display(); + lcd_putsxy(10, 20, "YOU WIN!!", 2); lcd_update(); + lcd_invertrect(0,0,111,63); + lcd_update();*/ } return; } @@ -572,8 +947,16 @@ void sokoban(void) lcd_clear_display(); lcd_putsxy(LCD_WIDTH/2-len, (LCD_HEIGHT/2)-h, SOKOBAN_TITLE, SOKOBAN_TITLE_FONT); - lcd_putsxy( 3,42, "[Off] to stop", 0); - lcd_putsxy( 3,52, "[F1] + level",0); + + lcd_update(); + sleep(HZ*2); + + lcd_clear_display(); + + lcd_putsxy( 3,12, "[Off] to stop", 0); + lcd_putsxy( 3,22, "[F1] - level",0); + lcd_putsxy( 3,32, "[F2] same level",0); + lcd_putsxy( 3,42, "[F3] + level",0); lcd_update(); sleep(HZ*2);