Browse Source

snake new control: don't allow snake to go to opposite direction

feature/2015
kju 15 years ago
parent
commit
12db75f1b1
  1. 4
      games/snake/snake_game.c

4
games/snake/snake_game.c

@ -62,6 +62,10 @@ void snake_game() {
#ifdef GAME_SNAKE_NEWCONTROL
if (joy_cmd != 0xff)
{
if ( (dir == left && joy_cmd != right) ||
(dir == right && joy_cmd != left) ||
(dir == up && joy_cmd != down) ||
(dir == down && joy_cmd != up) )
dir = joy_cmd;
}
#else

Loading…
Cancel
Save