Update: CC - Snake FS - Key Up (306204wy29.js) 386 bytes modified
parent
f6481a4bb3
commit
1570889cdd
|
@ -3,13 +3,31 @@ if (!this.entityLoaded) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.initialized) {
|
if (!this.initialized) {
|
||||||
|
this.direction = this.entityLoaded.direction;
|
||||||
this.initialized = true;
|
this.initialized = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data.keyCode === GameLib.System.Input.KEY_UP) {
|
if (data.keyCode === GameLib.System.Input.KEY_UP) {
|
||||||
console.log('key up');
|
this.direction.y = 1;
|
||||||
|
this.direction.x = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (data.keyCode === GameLib.System.Input.KEY_DOWN) {
|
||||||
|
this.direction.y = -1;
|
||||||
|
this.direction.x = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (data.keyCode === GameLib.System.Input.KEY_LEFT) {
|
||||||
|
this.direction.y = 0;
|
||||||
|
this.direction.x = -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (data.keyCode === GameLib.System.Input.KEY_RIGHT) {
|
||||||
|
this.direction.y = 0;
|
||||||
|
this.direction.x = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
console.log(data);
|
console.log(data);
|
||||||
|
|
||||||
//@ sourceURL=keyUp.js
|
//@ sourceURL=keyUp.js
|
Loading…
Reference in New Issue