Skip to content

Commit

Permalink
keyboard input resumes the game
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulKappmeyer committed Oct 24, 2023
1 parent e7840b0 commit 6ad8aec
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions snake.js
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,10 @@ class Snake {
}

setMoveDirection(desiredDirection) {
if (running == false) {
toggleRunning();
}

if (isOppositeDirection(this.direction, desiredDirection)) {
return;
}
Expand Down

0 comments on commit 6ad8aec

Please sign in to comment.