Skip to content

Commit 6b5343d

Browse files
committed
fixed pause premove for all direction
1 parent a18cf5f commit 6b5343d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

js/snake.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ SNAKE.Snake = SNAKE.Snake || (function() {
249249
2
250250
*/
251251
me.handleArrowKeys = function(keyNum) {
252-
if (isDead || (isPaused && false)) {return;}
252+
if (isDead || (isPaused && false)) {return;}
253253

254254
var snakeLength = me.snakeLength;
255255

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

0 commit comments

Comments
 (0)