1
0
Fork 0
forked from len0rd/rockbox

Fixed button_get() problems

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1439 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Linus Nielsen Feltzing 2002-07-24 19:42:46 +00:00
parent 5ddd384e3d
commit 09fe394c3f

View file

@ -328,29 +328,34 @@ void game_loop(void)
{ {
while(1) while(1)
{ {
int b=0; int count = 0;
int count = 0; while(count * 300 < level_speeds[level])
while(count * 300 < level_speeds[level]) {
{ switch(button_get(false))
b = button_get(false); {
if ( b & BUTTON_OFF ) case BUTTON_OFF:
return; /* get out of here */ return;
if ( b & BUTTON_UP ) case BUTTON_UP:
move_block(0,-3,0); move_block(0,-3,0);
break;
if ( b & BUTTON_DOWN )
move_block(0,3,0); case BUTTON_DOWN:
move_block(0,3,0);
if ( b & BUTTON_RIGHT ) break;
move_block(0,0,1);
case BUTTON_RIGHT:
if ( b & BUTTON_LEFT ) move_block(0,0,1);
move_down(); break;
case BUTTON_LEFT:
move_down();
break;
}
count++; count++;
sleep(HZ/10); sleep(HZ/10);
} }
if(gameover()) if(gameover())
{ {
@ -361,7 +366,7 @@ void game_loop(void)
return; return;
} }
move_down(); move_down();
} }
} }