mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 14:37:46 +02:00
Fixing ping-ping entity script
This commit is contained in:
parent
88ba6cda24
commit
34b5178393
1 changed files with 9 additions and 8 deletions
|
@ -45,6 +45,12 @@
|
||||||
green: 255,
|
green: 255,
|
||||||
blue: 255
|
blue: 255
|
||||||
};
|
};
|
||||||
|
|
||||||
|
var TRIGGER_CONTROLS = [
|
||||||
|
Controller.Standard.LT,
|
||||||
|
Controller.Standard.RT,
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
PingPongGun.prototype = {
|
PingPongGun.prototype = {
|
||||||
hand: null,
|
hand: null,
|
||||||
|
@ -53,11 +59,11 @@
|
||||||
canShoot: false,
|
canShoot: false,
|
||||||
canShootTimeout: null,
|
canShootTimeout: null,
|
||||||
setRightHand: function() {
|
setRightHand: function() {
|
||||||
this.hand = 'RIGHT';
|
this.hand = 1;
|
||||||
},
|
},
|
||||||
|
|
||||||
setLeftHand: function() {
|
setLeftHand: function() {
|
||||||
this.hand = 'LEFT';
|
this.hand = 0;
|
||||||
},
|
},
|
||||||
|
|
||||||
startNearGrab: function() {
|
startNearGrab: function() {
|
||||||
|
@ -92,12 +98,7 @@
|
||||||
},
|
},
|
||||||
|
|
||||||
checkTriggerPressure: function(gunHand) {
|
checkTriggerPressure: function(gunHand) {
|
||||||
var handClickString = gunHand + "_HAND_CLICK";
|
this.triggerValue = Controller.getValue(TRIGGER_CONTROLS[gunHand]);
|
||||||
|
|
||||||
var handClick = Controller.findAction(handClickString);
|
|
||||||
|
|
||||||
this.triggerValue = Controller.getActionValue(handClick);
|
|
||||||
|
|
||||||
if (this.triggerValue < RELOAD_THRESHOLD) {
|
if (this.triggerValue < RELOAD_THRESHOLD) {
|
||||||
// print('RELOAD');
|
// print('RELOAD');
|
||||||
this.canShoot = true;
|
this.canShoot = true;
|
||||||
|
|
Loading…
Reference in a new issue