Make absolutely certain we sent a direction turn command
This commit is contained in:
parent
4e03338291
commit
c34811fdf4
6
data
6
data
@ -1,7 +1,7 @@
|
|||||||
Hit other
|
Hit other
|
||||||
923
|
923
|
||||||
500
|
504
|
||||||
62775
|
63224
|
||||||
954
|
954
|
||||||
Bot 5653
|
Bot 5653
|
||||||
|
|
6
index.js
6
index.js
@ -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…
x
Reference in New Issue
Block a user