Make absolutely certain we sent a direction turn command

master
sigonasr2 3 years ago
parent 4e03338291
commit c34811fdf4
  1. 8
      data
  2. 6
      index.js

@ -1,7 +1,7 @@
Hit other Hit other
923 923
500 504
62775 63224
954 954
Bot 5653 Bot 5653

@ -166,10 +166,12 @@ snake.onTick = function(obj) { // When the game updates
} }
function setDirection(dir) { function setDirection(dir) {
if (myDir!==dir) {
for (var i=0;i<10;i++) {
snake.setDirection(dir) snake.setDirection(dir)
myDir=dir
} }
myDir=dir
} }
function spotIsFree(dir, x, y) { function spotIsFree(dir, x, y) {

Loading…
Cancel
Save