Update: CC - Snake FS - Key Up (306204wy29.js) 209 bytes modified
parent
c822aa11df
commit
e596b1a02a
|
@ -11,7 +11,21 @@ if (data.keyCode === GameLib.System.Input.KEY_UP) {
|
||||||
if (this.direction.y === -1) {
|
if (this.direction.y === -1) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.direction.y = 1;
|
|
||||||
|
if (this.direction.y === 1) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.direction.x === 1) {
|
||||||
|
this.direction.y = 1;
|
||||||
|
this.rotation += Math.PI / 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.direction.x === -1) {
|
||||||
|
this.direction.y = 1;
|
||||||
|
this.rotation -= Math.PI / 2;
|
||||||
|
}
|
||||||
|
|
||||||
this.direction.x = 0;
|
this.direction.x = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue