Update: CC - Entity Loaded - AR Football 3 (ff0fsum4zx.js) 54 bytes modified
parent
15d4e3cb57
commit
cb56d0778a
|
@ -127,16 +127,13 @@ R3.CustomCode.prototype.render = function(delta) {
|
||||||
if (this.shooting === true) {
|
if (this.shooting === true) {
|
||||||
|
|
||||||
this.move(
|
this.move(
|
||||||
|
|
||||||
{
|
{
|
||||||
x : 0,
|
x : 0,
|
||||||
y : 10 * delta
|
y : 1000 * delta
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
if (this.playerRotation.y < 0) {
|
|
||||||
this.playerRotation.y = 0;
|
|
||||||
this.shooting = false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.totalTime <= 0) {
|
if (this.totalTime <= 0) {
|
||||||
|
@ -360,7 +357,7 @@ R3.CustomCode.prototype.move = function(data) {
|
||||||
* Clamp player rotation to values between 0 and Math.PI * 2
|
* Clamp player rotation to values between 0 and Math.PI * 2
|
||||||
*/
|
*/
|
||||||
if (this.playerRotation.y > Math.PI) {
|
if (this.playerRotation.y > Math.PI) {
|
||||||
this.playerRotation.y = Math.PI;
|
this.playerRotation.y = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.playerRotation.y < -Math.PI) {
|
if (this.playerRotation.y < -Math.PI) {
|
||||||
|
@ -393,7 +390,7 @@ R3.CustomCode.prototype.move = function(data) {
|
||||||
this.startTime = Date.now();
|
this.startTime = Date.now();
|
||||||
}
|
}
|
||||||
|
|
||||||
this.kickDistance += Math.abs(y);
|
//this.kickDistance += Math.abs(y);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -402,7 +399,7 @@ R3.CustomCode.prototype.move = function(data) {
|
||||||
* We are no longer moving down, also reset our Y distance counter
|
* We are no longer moving down, also reset our Y distance counter
|
||||||
* @type {boolean}
|
* @type {boolean}
|
||||||
*/
|
*/
|
||||||
this.kickDistance = 0;
|
//this.kickDistance = 0;
|
||||||
this.startTime = null;
|
this.startTime = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -430,6 +427,8 @@ R3.CustomCode.prototype.move = function(data) {
|
||||||
|
|
||||||
this.kick = false;
|
this.kick = false;
|
||||||
|
|
||||||
|
this.shooting = false;
|
||||||
|
|
||||||
if (this.startTime === null) {
|
if (this.startTime === null) {
|
||||||
console.warn('no kick start time');
|
console.warn('no kick start time');
|
||||||
return;
|
return;
|
||||||
|
@ -442,9 +441,11 @@ R3.CustomCode.prototype.move = function(data) {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
var kickDuration = Date.now() - this.startTime;
|
//var kickDuration = 1;//Date.now() - this.startTime;
|
||||||
|
|
||||||
var speed = this.kickDistance / kickDuration * 20;
|
var speed = this.kickDistance;
|
||||||
|
|
||||||
|
console.log('speed = ' + speed);
|
||||||
|
|
||||||
// if (speed > 1.5) {
|
// if (speed > 1.5) {
|
||||||
// speed = 1.5;
|
// speed = 1.5;
|
||||||
|
@ -476,7 +477,7 @@ R3.CustomCode.prototype.move = function(data) {
|
||||||
kickDuration : this.kickDuration,
|
kickDuration : this.kickDuration,
|
||||||
kickDistance : this.kickDistance,
|
kickDistance : this.kickDistance,
|
||||||
kickSpeed : speed,
|
kickSpeed : speed,
|
||||||
upAngle : Math.PI * speed,
|
upAngle : speed,
|
||||||
v : v,
|
v : v,
|
||||||
vRotationAxis : vRotationAxis,
|
vRotationAxis : vRotationAxis,
|
||||||
t : 0,
|
t : 0,
|
||||||
|
@ -492,7 +493,7 @@ R3.CustomCode.prototype.move = function(data) {
|
||||||
this.activeBall = null;
|
this.activeBall = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
}.bind(this)
|
}.bind(this);
|
||||||
|
|
||||||
|
|
||||||
R3.Event.Subscribe(
|
R3.Event.Subscribe(
|
||||||
|
@ -541,8 +542,13 @@ R3.Event.Subscribe(
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data.type === 'shoot_release') {
|
if (data.type === 'shoot_release') {
|
||||||
console.log('shoot release');
|
|
||||||
this.shooting = true;
|
this.shooting = true;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
this.kickDistance = Math.abs(this.playerRotation.y);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data.type === 'look_left') {
|
if (data.type === 'look_left') {
|
||||||
|
|
Loading…
Reference in New Issue