summaryrefslogtreecommitdiff
path: root/apps/recorder
diff options
context:
space:
mode:
Diffstat (limited to 'apps/recorder')
-rw-r--r--apps/recorder/tetris.c51
1 files changed, 28 insertions, 23 deletions
diff --git a/apps/recorder/tetris.c b/apps/recorder/tetris.c
index e9653d1774..84f338ea50 100644
--- a/apps/recorder/tetris.c
+++ b/apps/recorder/tetris.c
@@ -328,29 +328,34 @@ void game_loop(void)
328{ 328{
329 while(1) 329 while(1)
330 { 330 {
331 int b=0; 331 int count = 0;
332 int count = 0; 332 while(count * 300 < level_speeds[level])
333 while(count * 300 < level_speeds[level]) 333 {
334 { 334 switch(button_get(false))
335 b = button_get(false); 335 {
336 if ( b & BUTTON_OFF ) 336 case BUTTON_OFF:
337 return; /* get out of here */ 337 return;
338 338
339 if ( b & BUTTON_UP ) 339 case BUTTON_UP:
340 move_block(0,-3,0); 340 move_block(0,-3,0);
341 341 break;
342 if ( b & BUTTON_DOWN ) 342
343 move_block(0,3,0); 343 case BUTTON_DOWN:
344 344 move_block(0,3,0);
345 if ( b & BUTTON_RIGHT ) 345 break;
346 move_block(0,0,1); 346
347 347 case BUTTON_RIGHT:
348 if ( b & BUTTON_LEFT ) 348 move_block(0,0,1);
349 move_down(); 349 break;
350 350
351 case BUTTON_LEFT:
352 move_down();
353 break;
354 }
355
351 count++; 356 count++;
352 sleep(HZ/10); 357 sleep(HZ/10);
353 } 358 }
354 359
355 if(gameover()) 360 if(gameover())
356 { 361 {
@@ -361,7 +366,7 @@ void game_loop(void)
361 return; 366 return;
362 } 367 }
363 368
364 move_down(); 369 move_down();
365 } 370 }
366} 371}
367 372