diff options
author | Eric Linenberg <elinenbe@umich.edu> | 2002-06-19 14:26:41 +0000 |
---|---|---|
committer | Eric Linenberg <elinenbe@umich.edu> | 2002-06-19 14:26:41 +0000 |
commit | 369233657f75fd76bcc19d9a066ba524b405d235 (patch) | |
tree | a4ab0a25775925b5c2e7fb6ec91f848fe5f2d0e9 | |
parent | 6d96b50ac9e89135e690f6c712e2e8cfcf174ef9 (diff) | |
download | rockbox-369233657f75fd76bcc19d9a066ba524b405d235.tar.gz rockbox-369233657f75fd76bcc19d9a066ba524b405d235.zip |
Added more levels, also now you can restart a level and move back and forth between the levels
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1082 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/recorder/sokoban.c | 433 |
1 files changed, 408 insertions, 25 deletions
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 @@ | |||
31 | 31 | ||
32 | #define SOKOBAN_TITLE "Sokoban" | 32 | #define SOKOBAN_TITLE "Sokoban" |
33 | #define SOKOBAN_TITLE_FONT 2 | 33 | #define SOKOBAN_TITLE_FONT 2 |
34 | #define NUM_LEVELS 4 | 34 | #define NUM_LEVELS 25 |
35 | 35 | ||
36 | int board[16][20]; | 36 | int board[16][20]; |
37 | int current_level=0; | 37 | int current_level=0; |
@@ -110,24 +110,374 @@ int levels[320*NUM_LEVELS] = { | |||
110 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, | 110 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, |
111 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, | 111 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, |
112 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, | 112 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, |
113 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 | 113 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, |
114 | /* level 40 | 114 | /* level 05 */ |
115 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, | ||
116 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, | ||
117 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, | ||
118 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, | ||
119 | 0,0,0,0,0,0,0,2,2,2,2,0,0,0,0,0,0,0,0,0, | ||
120 | 0,0,0,0,0,0,0,2,5,1,2,2,2,0,0,0,0,0,0,0, | ||
121 | 0,0,0,0,0,0,0,2,1,4,1,1,2,0,0,0,0,0,0,0, | ||
122 | 0,0,0,0,0,0,2,2,2,1,2,1,2,2,0,0,0,0,0,0, | ||
123 | 0,0,0,0,0,0,2,3,2,1,2,1,1,2,0,0,0,0,0,0, | ||
124 | 0,0,0,0,0,0,2,3,4,1,1,2,1,2,0,0,0,0,0,0, | ||
125 | 0,0,0,0,0,0,2,3,1,1,1,4,1,2,0,0,0,0,0,0, | ||
126 | 0,0,0,0,0,0,2,2,2,2,2,2,2,2,0,0,0,0,0,0, | ||
127 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, | ||
128 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, | ||
129 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, | ||
130 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, | ||
131 | /* level 06 */ | ||
132 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, | ||
133 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, | 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178 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, | ||
179 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, | ||
180 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, | ||
181 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, | ||
182 | /* level 09 */ | ||
183 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, | ||
184 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, | ||
185 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, | ||
186 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, | ||
187 | 0,0,0,0,0,0,0,0,2,2,2,2,0,0,0,0,0,0,0,0, | ||
188 | 0,0,0,0,0,0,0,0,2,3,3,2,0,0,0,0,0,0,0,0, | ||
189 | 0,0,0,0,0,0,0,2,2,1,3,2,2,0,0,0,0,0,0,0, | ||
190 | 0,0,0,0,0,0,0,2,1,1,4,3,2,0,0,0,0,0,0,0, | ||
191 | 0,0,0,0,0,0,2,2,1,4,1,1,2,2,0,0,0,0,0,0, | ||
192 | 0,0,0,0,0,0,2,1,1,2,4,4,1,2,0,0,0,0,0,0, | ||
193 | 0,0,0,0,0,0,2,1,1,5,1,1,1,2,0,0,0,0,0,0, | ||
194 | 0,0,0,0,0,0,2,2,2,2,2,2,2,2,0,0,0,0,0,0, | ||
195 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, | ||
196 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, | ||
197 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, | ||
198 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, | ||
199 | /* level 10 */ | ||
200 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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,0,0,0, | ||
267 | /* level 14 */ | ||
268 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, | ||
269 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, | ||
270 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, | ||
271 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, | ||
272 | 0,0,0,0,0,0,0,2,2,2,2,2,2,2,2,0,0,0,0,0, | ||
273 | 0,0,0,0,0,0,0,2,1,1,1,2,3,1,2,0,0,0,0,0, | ||
274 | 0,0,0,0,0,0,2,2,1,1,4,3,3,3,2,0,0,0,0,0, | ||
275 | 0,0,0,0,0,0,2,1,1,4,1,2,1,3,2,0,0,0,0,0, | ||
276 | 0,0,0,0,0,2,2,1,2,2,4,2,1,2,2,0,0,0,0,0, | ||
277 | 0,0,0,0,0,2,1,1,1,4,1,1,4,1,2,0,0,0,0,0, | ||
278 | 0,0,0,0,0,2,1,1,1,2,1,1,1,1,2,0,0,0,0,0, | ||
279 | 0,0,0,0,0,2,2,2,2,2,2,2,5,1,2,0,0,0,0,0, | ||
280 | 0,0,0,0,0,0,0,0,0,0,0,2,2,2,2,0,0,0,0,0, | ||
281 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, | ||
282 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, | ||
283 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, | ||
284 | /* level 15 */ | ||
285 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, | ||
286 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, | ||
287 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, | ||
288 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, | ||
289 | 0,0,0,0,0,0,2,2,2,2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0, | ||
385 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, | ||
386 | /* level 21 */ | ||
387 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, | ||
388 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, | ||
389 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, | ||
390 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, | ||
391 | 0,0,0,0,0,0,0,2,2,2,2,2,2,0,0,0,0,0,0,0, | ||
392 | 0,0,0,0,0,0,0,2,3,1,3,3,2,0,0,0,0,0,0,0, | ||
393 | 0,0,0,0,0,0,0,2,3,1,4,3,2,0,0,0,0,0,0,0, | ||
394 | 0,0,0,0,0,0,2,2,2,1,1,4,2,2,0,0,0,0,0,0, | ||
395 | 0,0,0,0,0,0,2,1,4,1,1,4,1,2,0,0,0,0,0,0, | ||
396 | 0,0,0,0,0,0,2,1,2,4,2,2,1,2,0,0,0,0,0,0, | ||
397 | 0,0,0,0,0,0,2,1,1,1,5,1,1,2,0,0,0,0,0,0, | ||
398 | 0,0,0,0,0,0,2,2,2,2,2,2,2,2,0,0,0,0,0,0, | ||
399 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, | ||
400 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, | ||
401 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, | ||
402 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, | ||
403 | /* level 22 */ | ||
404 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, | ||
405 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, | ||
406 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, | ||
407 | 0,0,0,0,0,0,0,0,0,0,0,0,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0,0,0,0,0,0,0, | ||
452 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, | ||
453 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, | ||
454 | /* level 25 */ | ||
455 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, | ||
456 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, | ||
457 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, | ||
458 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, | ||
459 | 0,0,0,0,0,0,0,0,2,2,2,2,2,2,2,2,0,0,0,0, | ||
460 | 0,0,0,0,0,2,2,2,2,1,1,1,1,3,1,2,0,0,0,0, | ||
461 | 0,0,0,0,0,2,1,1,4,1,4,1,4,3,1,2,0,0,0,0, | ||
462 | 0,0,0,0,0,2,1,1,3,2,2,2,2,3,2,2,0,0,0,0, | ||
463 | 0,0,0,0,0,2,1,4,3,4,1,4,1,5,2,0,0,0,0,0, | ||
464 | 0,0,0,0,0,2,1,1,3,1,1,1,1,2,2,0,0,0,0,0, | ||
465 | 0,0,0,0,0,2,2,2,2,2,2,2,2,2,0,0,0,0,0,0, | ||
466 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, | ||
467 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, | ||
468 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, | ||
469 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, | ||
470 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 | ||
471 | /* level 26 */ | ||
472 | |||
473 | /* level 27 */ | ||
474 | |||
475 | /* level 28 */ | ||
476 | |||
477 | /* level 29 */ | ||
478 | |||
479 | /* level 30 */ | ||
480 | |||
131 | }; | 481 | }; |
132 | 482 | ||
133 | 483 | ||
@@ -137,6 +487,7 @@ void load_level(int level_to_load) { | |||
137 | int b = 0; | 487 | int b = 0; |
138 | int c = 0; | 488 | int c = 0; |
139 | 489 | ||
490 | boxes_to_go = 0; | ||
140 | /* load level into board */ | 491 | /* load level into board */ |
141 | /* get to the current level in the level array */ | 492 | /* get to the current level in the level array */ |
142 | a = level_to_load*320; | 493 | a = level_to_load*320; |
@@ -238,11 +589,34 @@ void sokoban_loop(void) { | |||
238 | } | 589 | } |
239 | 590 | ||
240 | 591 | ||
241 | if ( b & BUTTON_F1 ) { | 592 | if ( b & BUTTON_F3 ) { |
242 | /* get out of here */ | 593 | /* increase level */ |
243 | boxes_to_go=0; | 594 | boxes_to_go=0; |
244 | } | 595 | } |
245 | 596 | ||
597 | if ( b & BUTTON_F2 ) { | ||
598 | /* same level */ | ||
599 | load_level(current_level); | ||
600 | lcd_clear_display(); | ||
601 | update_screen(); | ||
602 | moves=0; | ||
603 | |||
604 | } | ||
605 | |||
606 | if ( b & BUTTON_F1 ) { | ||
607 | /* previous level */ | ||
608 | if (current_level==0) { | ||
609 | current_level=0; | ||
610 | } | ||
611 | else { | ||
612 | current_level--; | ||
613 | } | ||
614 | load_level(current_level); | ||
615 | lcd_clear_display(); | ||
616 | update_screen(); | ||
617 | moves=0; | ||
618 | } | ||
619 | |||
246 | if ( b & BUTTON_LEFT ) { | 620 | if ( b & BUTTON_LEFT ) { |
247 | /* if it is a blank spot */ | 621 | /* if it is a blank spot */ |
248 | if (board[row][col-1]==1) { | 622 | if (board[row][col-1]==1) { |
@@ -528,17 +902,18 @@ void sokoban_loop(void) { | |||
528 | update_screen(); | 902 | update_screen(); |
529 | } | 903 | } |
530 | 904 | ||
905 | |||
906 | |||
531 | if (boxes_to_go==0) { | 907 | if (boxes_to_go==0) { |
532 | moves=0; | 908 | moves=0; |
533 | current_level++; | 909 | current_level++; |
534 | if (current_level == NUM_LEVELS) { | 910 | if (current_level == NUM_LEVELS) { |
535 | lcd_clear_display(); | 911 | for(ii=0; ii<30 ; ii++) { |
536 | lcd_putsxy(10, 20, "YOU WIN!!", 2); | 912 | lcd_clear_display(); |
537 | 913 | lcd_putsxy(10, 20, "YOU WIN!!", 2); | |
538 | lcd_update(); | ||
539 | for (ii=0 ; ii<20 ; ii++) { | ||
540 | lcd_invertrect(0,0,111,63); | ||
541 | lcd_update(); | 914 | lcd_update(); |
915 | lcd_invertrect(0,0,111,63); | ||
916 | lcd_update();*/ | ||
542 | } | 917 | } |
543 | return; | 918 | return; |
544 | } | 919 | } |
@@ -572,8 +947,16 @@ void sokoban(void) | |||
572 | lcd_clear_display(); | 947 | lcd_clear_display(); |
573 | lcd_putsxy(LCD_WIDTH/2-len, (LCD_HEIGHT/2)-h, SOKOBAN_TITLE, | 948 | lcd_putsxy(LCD_WIDTH/2-len, (LCD_HEIGHT/2)-h, SOKOBAN_TITLE, |
574 | SOKOBAN_TITLE_FONT); | 949 | SOKOBAN_TITLE_FONT); |
575 | lcd_putsxy( 3,42, "[Off] to stop", 0); | 950 | |
576 | lcd_putsxy( 3,52, "[F1] + level",0); | 951 | lcd_update(); |
952 | sleep(HZ*2); | ||
953 | |||
954 | lcd_clear_display(); | ||
955 | |||
956 | lcd_putsxy( 3,12, "[Off] to stop", 0); | ||
957 | lcd_putsxy( 3,22, "[F1] - level",0); | ||
958 | lcd_putsxy( 3,32, "[F2] same level",0); | ||
959 | lcd_putsxy( 3,42, "[F3] + level",0); | ||
577 | 960 | ||
578 | lcd_update(); | 961 | lcd_update(); |
579 | sleep(HZ*2); | 962 | sleep(HZ*2); |