patorjk / JavaScript-Snake

The game of Snake written in JavaScript.
MIT License
531 stars 628 forks source link

Arrow key pause #87

Closed Rb64 closed 2 years ago

Rb64 commented 2 years ago

I added the optional functionality similarl to how it was described in Issue #80. To activate this functionality set premoveOnPause: true in init.js. When the game is paused the next move can be set by using the keys as usual. I made sure to prevent a 180° turn.

patorjk commented 2 years ago

Thank you for putting this together, this looks good. I'll probably change the default to have this on.