History

pistol adjustments

James B. Pollack committed 10 years ago

Commit d258c9e1 parent 4c663b91 file · +4 −4Browse files

Showing the changes to scripts/tutorials/entity_scripts (1 of 1 file). Show all

Unified · Split

scripts/tutorials/entity_scripts/pistol.js+4−4
@@ -22,7 +22,7 @@ · 21 unmodified lines
22 Controller.Standard.LT,22 Controller.Standard.LT,
23 Controller.Standard.RT,23 Controller.Standard.RT,
24 ];24 ];
25 var RELOAD_THRESHOLD = 0.95;25 var RELOAD_THRESHOLD = 0.90;
26 26
27 Pistol = function() {27 Pistol = function() {
28 _this = this;28 _this = this;
@@ -81,11 +81,11 @@ · 52 unmodified lines
81 },81 },
82 toggleWithTriggerPressure: function() {82 toggleWithTriggerPressure: function() {
83 this.triggerValue = Controller.getValue(TRIGGER_CONTROLS[this.hand]);83 this.triggerValue = Controller.getValue(TRIGGER_CONTROLS[this.hand]);
84 84
85 if (this.triggerValue < RELOAD_THRESHOLD) {85 if (this.triggerValue < RELOAD_THRESHOLD) {
86 this.canShoot = true;86 this.canShoot = true;
87 }87 }
88 if (this.canShoot === true && this.triggerValue === 1) {88 if (this.canShoot === true && this.triggerValue >= RELOAD_THRESHOLD) {
89 this.fire();89 this.fire();
90 this.canShoot = false;90 this.canShoot = false;
91 }91 }
@@ -140,7 +140,7 @@ · 48 unmodified lines
140 direction: this.firingDirection140 direction: this.firingDirection
141 };141 };
142 this.createGunFireEffect(this.barrelPoint)142 this.createGunFireEffect(this.barrelPoint)
143 var intersection = Entities.findRayIntersectionBlocking(pickRay, true);143 var intersection = Entities.findRayIntersection(pickRay, true);
144 if (intersection.intersects) {144 if (intersection.intersects) {
145 this.createEntityHitEffect(intersection.intersection);145 this.createEntityHitEffect(intersection.intersection);
146 if (Math.random() < this.playRichochetSoundChance) {146 if (Math.random() < this.playRichochetSoundChance) {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t