Update: CC - Entity Loaded - AR Football 3 (ff0fsum4zx.js) 485 bytes modified
parent
85ff364169
commit
4a384b3e5b
|
@ -85,6 +85,8 @@ this.invertY = true;
|
||||||
|
|
||||||
this.invertX = true;
|
this.invertX = true;
|
||||||
|
|
||||||
|
this.shooting = false;
|
||||||
|
|
||||||
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),
|
||||||
|
@ -120,7 +122,22 @@ R3.CustomCode.prototype.render = function(delta) {
|
||||||
type : 'timer',
|
type : 'timer',
|
||||||
time : this.totalTime
|
time : this.totalTime
|
||||||
}
|
}
|
||||||
)
|
);
|
||||||
|
|
||||||
|
if (this.shooting === true) {
|
||||||
|
|
||||||
|
this.move(
|
||||||
|
{
|
||||||
|
x : 0,
|
||||||
|
y : 10 * delta
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
if (this.playerRotation.y < 0) {
|
||||||
|
this.playerRotation.y = 0;
|
||||||
|
this.shooting = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (this.totalTime <= 0) {
|
if (this.totalTime <= 0) {
|
||||||
|
|
||||||
|
@ -508,12 +525,24 @@ R3.Event.Subscribe(
|
||||||
R3.Event.Subscribe(
|
R3.Event.Subscribe(
|
||||||
R3.Event.GAME_DATA,
|
R3.Event.GAME_DATA,
|
||||||
function(data) {
|
function(data) {
|
||||||
if (data.type === 'shoot_start') {
|
|
||||||
console.log('shoot start');
|
if (data.type === 'shoot') {
|
||||||
|
|
||||||
|
console.log('shoot');
|
||||||
|
|
||||||
|
this.shooting = false;
|
||||||
|
|
||||||
|
this.move(
|
||||||
|
{
|
||||||
|
x : 0,
|
||||||
|
y : -10
|
||||||
|
}
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data.type === 'shoot_release') {
|
if (data.type === 'shoot_release') {
|
||||||
console.log('shoot release');
|
console.log('shoot release');
|
||||||
|
this.shooting = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data.type === 'look_left') {
|
if (data.type === 'look_left') {
|
||||||
|
@ -522,7 +551,7 @@ R3.Event.Subscribe(
|
||||||
x : -10,
|
x : -10,
|
||||||
y : 0
|
y : 0
|
||||||
}
|
}
|
||||||
)
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data.type === 'look_right') {
|
if (data.type === 'look_right') {
|
||||||
|
@ -531,7 +560,7 @@ R3.Event.Subscribe(
|
||||||
x : 10,
|
x : 10,
|
||||||
y : 0
|
y : 0
|
||||||
}
|
}
|
||||||
)
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
}.bind(this)
|
}.bind(this)
|
||||||
|
|
Loading…
Reference in New Issue