From 61d43d317d2289502379799984207883108768ba Mon Sep 17 00:00:00 2001 From: -=yb4f310 Date: Mon, 28 May 2018 17:13:38 +0200 Subject: [PATCH] Update: CC - Entity Loaded - AR Football 3 (ff0fsum4zx.js) 72 bytes modified --- ff0fsum4zx.js | 54 ++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 38 insertions(+), 16 deletions(-) diff --git a/ff0fsum4zx.js b/ff0fsum4zx.js index 7fac407..522120e 100644 --- a/ff0fsum4zx.js +++ b/ff0fsum4zx.js @@ -41,7 +41,7 @@ this.playerRotation = { y : 0 }; -R3.CustomCode.TIME_LIMIT = 90; +R3.CustomCode.TIME_LIMIT = 45; this.balls = []; @@ -79,6 +79,10 @@ this.ballY = this.football.instance.geometry.boundingSphere.radius / 2; this.activeBall = null; +this.invertY = true; + +this.invertX = true; + if (this.debug) { this.arrowHelper = new THREE.ArrowHelper( new THREE.Vector3(0,0,-1), @@ -108,17 +112,13 @@ R3.CustomCode.prototype.render = function(delta) { this.totalTime -= delta; - this.secondCounter += delta; - if (this.secondCounter >= 1) { - this.secondCounter -= 1; - R3.Event.Emit( - R3.Event.GAME_DATA, - { - type : 'timer', - time : Math.round(this.totalTime) - } - ) - } + R3.Event.Emit( + R3.Event.GAME_DATA, + { + type : 'timer', + time : this.totalTime + } + ) if (this.totalTime <= 0) { @@ -138,7 +138,8 @@ R3.CustomCode.prototype.render = function(delta) { return result; }, [] - ) + ), + totalBalls : this.balls.length } ) } @@ -307,10 +308,31 @@ R3.CustomCode.prototype.render = function(delta) { R3.CustomCode.prototype.move = function(data) { - var x = data.x || 0; - var y = data.y || 0; - x *= 0.0025; + var x = 0; + + if (data && data.x) { + if (this.invertX) { + x = data.x; + } else { + x = -data.x; + } + } + + var y = 0; + + if (data && data.y) { + + if (this.invertY) { + y = data.y; + } else { + y = -data.y; + } + + } + + x *= 0.0025; y *= 0.0075; + this.playerRotation.x += x; this.playerRotation.y += y;