Update: CC - Snake FS - Key Up (306204wy29.js) 209 bytes modified

beta.r3js.org
-=yb4f310 2018-03-13 13:48:57 +01:00
parent c822aa11df
commit e596b1a02a
1 changed files with 15 additions and 1 deletions

View File

@ -11,7 +11,21 @@ if (data.keyCode === GameLib.System.Input.KEY_UP) {
if (this.direction.y === -1) {
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;
}