From b798eee9d223b5f99e99bc441c0961a473885790 Mon Sep 17 00:00:00 2001 From: Theunis Johannes Botha Date: Mon, 28 May 2018 17:54:15 +0200 Subject: [PATCH] Update: CC - Entity Loaded - AR Football 3 (ff0fsum4zx.js) 948 bytes modified --- ff0fsum4zx.js | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/ff0fsum4zx.js b/ff0fsum4zx.js index 522120e..8b3240f 100644 --- a/ff0fsum4zx.js +++ b/ff0fsum4zx.js @@ -10,6 +10,8 @@ if (data.entity === this.parentEntity) { this.mouseMove = R3.EntityManager.Instance.findComponentById('dwxvtxzrun'); this.touchMove = R3.EntityManager.Instance.findComponentById('p49pad0i7l'); this.beforeRender = R3.EntityManager.Instance.findComponentById('7l8ar325qf'); +this.keyDown = R3.EntityManager.Instance.findComponentById('905x4c8pna'); +this.keyUp = R3.EntityManager.Instance.findComponentById('r5kzahijoq'); /** * Meshes @@ -497,6 +499,40 @@ R3.Event.Subscribe( this.mouseMove.entityLoaded = null; this.touchMove.entityLoaded = null; this.beforeRender.entityLoaded = null; + this.keyDown.entityLoaded = null; + this.keyUp.entityLoaded = null; + + }.bind(this) +); + +R3.Event.Subscribe( + R3.Event.GAME_DATA, + function(data) { + if (data.type === 'shoot_start') { + console.log('shoot start'); + } + + if (data.type === 'shoot_release') { + console.log('shoot release'); + } + + if (data.type === 'look_left') { + this.move( + { + x : -10, + y : 0 + } + ) + } + + if (data.type === 'look_right') { + this.move( + { + x : 10, + y : 0 + } + ) + } }.bind(this) ); @@ -586,6 +622,8 @@ R3.Event.Subscribe( this.mouseMove.entityLoaded = this; this.touchMove.entityLoaded = this; this.beforeRender.entityLoaded = this; + this.keyDown.entityLoaded = this; + this.keyUp.entityLoaded = this; }.bind(this) );