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
};
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;