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

beta.r3js.org
-=yb4f310 2018-03-19 08:30:00 +01:00
parent 0f00831ae4
commit 8876d30a3f
1 changed files with 8 additions and 2 deletions

View File

@ -10,8 +10,8 @@ if (!this.initialized) {
}
if (this.state.turning) {
//console.warn('already turning - todo: store the input and play back');
//return;
//console.warn('already turning - todo: store the input and play back');
//return;
}
if (data.keyCode === GameLib.System.Input.KEY_UP) {
@ -71,6 +71,12 @@ if (data.keyCode === GameLib.System.Input.KEY_LEFT) {
this.state.orientation === GameLib.CustomCode.ORIENTATION_UP ||
this.state.orientation === GameLib.CustomCode.ORIENTATION_DOWN
) {
if (this.state.orientation === GameLib.CustomCode.ORIENTATION_DOWN) {
this.state.flip = true;
} else {
this.state.flip = false;
}
this.state.orientation = GameLib.CustomCode.ORIENTATION_LEFT;
this.state.turning = true;
}