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
2222 Controller.Standard.LT,
2323 Controller.Standard.RT,
2424 ];
25− var RELOAD_THRESHOLD = 0.95;
25+ var RELOAD_THRESHOLD = 0.90;
2626
2727 Pistol = function() {
2828 _this = this;
@@ -81,11 +81,11 @@ · 52 unmodified lines
8181 },
8282 toggleWithTriggerPressure: function() {
8383 this.triggerValue = Controller.getValue(TRIGGER_CONTROLS[this.hand]);
84−
84+
8585 if (this.triggerValue < RELOAD_THRESHOLD) {
8686 this.canShoot = true;
8787 }
88− if (this.canShoot === true && this.triggerValue === 1) {
88+ if (this.canShoot === true && this.triggerValue >= RELOAD_THRESHOLD) {
8989 this.fire();
9090 this.canShoot = false;
9191 }
@@ -140,7 +140,7 @@ · 48 unmodified lines
140140 direction: this.firingDirection
141141 };
142142 this.createGunFireEffect(this.barrelPoint)
143− var intersection = Entities.findRayIntersectionBlocking(pickRay, true);
143+ var intersection = Entities.findRayIntersection(pickRay, true);
144144 if (intersection.intersects) {
145145 this.createEntityHitEffect(intersection.intersection);
146146 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