diff --git a/src/main.c b/src/main.c index c24827c..7403ed4 100644 --- a/src/main.c +++ b/src/main.c @@ -55,12 +55,16 @@ int main(int argc, char **argv) case 'q': *running = false; return 0; case 'w': + if (player->direction == DOWN) break; player->direction = UP; break; case 'd': + if (player->direction == LEFT) break; player->direction = RIGHT; break; case 's': + if (player->direction == UP) break; player->direction = DOWN; break; case 'a': + if (player->direction == RIGHT) break; player->direction = LEFT; break; }