Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a597378

Browse files
committed
fixed 180 degrees turn bug
1 parent 6b5343d commit a597378

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

js/snake.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ SNAKE.Snake = SNAKE.Snake || (function() {
280280
{
281281
preMove = directionFound;
282282
}
283-
if (Math.abs(directionFound - lastMove) !== 2 && (isFirstMove) || isFirstGameMove || isPaused) // Prevent snake from turning 180 degrees
283+
if (Math.abs(directionFound - lastMove) !== 2 && (isFirstMove || isPaused) || isFirstGameMove ) // Prevent snake from turning 180 degrees
284284
{
285285
currentDirection = directionFound;
286286
isFirstMove = false;

0 commit comments

Comments
 (0)