Update: CC - Entity Loaded - AR Football 3 (ff0fsum4zx.js) 72 bytes modified

beta.r3js.org
-=yb4f310 2018-05-28 17:13:38 +02:00
parent bd4743d44e
commit 61d43d317d
1 changed files with 38 additions and 16 deletions

View File

@ -41,7 +41,7 @@ this.playerRotation = {
y : 0 y : 0
}; };
R3.CustomCode.TIME_LIMIT = 90; R3.CustomCode.TIME_LIMIT = 45;
this.balls = []; this.balls = [];
@ -79,6 +79,10 @@ this.ballY = this.football.instance.geometry.boundingSphere.radius / 2;
this.activeBall = null; this.activeBall = null;
this.invertY = true;
this.invertX = true;
if (this.debug) { if (this.debug) {
this.arrowHelper = new THREE.ArrowHelper( this.arrowHelper = new THREE.ArrowHelper(
new THREE.Vector3(0,0,-1), new THREE.Vector3(0,0,-1),
@ -108,17 +112,13 @@ R3.CustomCode.prototype.render = function(delta) {
this.totalTime -= delta; this.totalTime -= delta;
this.secondCounter += delta; R3.Event.Emit(
if (this.secondCounter >= 1) { R3.Event.GAME_DATA,
this.secondCounter -= 1; {
R3.Event.Emit( type : 'timer',
R3.Event.GAME_DATA, time : this.totalTime
{ }
type : 'timer', )
time : Math.round(this.totalTime)
}
)
}
if (this.totalTime <= 0) { if (this.totalTime <= 0) {
@ -138,7 +138,8 @@ R3.CustomCode.prototype.render = function(delta) {
return result; return result;
}, },
[] []
) ),
totalBalls : this.balls.length
} }
) )
} }
@ -307,11 +308,32 @@ R3.CustomCode.prototype.render = function(delta) {
R3.CustomCode.prototype.move = function(data) { R3.CustomCode.prototype.move = function(data) {
var x = data.x || 0; var x = 0;
var y = data.y || 0;
x *= 0.0025; 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; y *= 0.0075;
this.playerRotation.x += x; this.playerRotation.x += x;
this.playerRotation.y += y; this.playerRotation.y += y;