haptics (fixes #13)

This commit is contained in:
Kevin Ngo
2018-09-20 04:01:41 -07:00
parent b52c833bf7
commit 5f9d4da31d
3 changed files with 8 additions and 4 deletions

6
package-lock.json generated
View File

@@ -154,9 +154,9 @@
"integrity": "sha1-+w+EQdrdHosRzCRRK6eqaS1iK+E="
},
"aframe-state-component": {
"version": "5.0.0-beta4",
"resolved": "https://registry.npmjs.org/aframe-state-component/-/aframe-state-component-5.0.0-beta4.tgz",
"integrity": "sha512-wcodZ5XP73/95K4ABxW6RWOHlIPv6HNk7oNx0M6lChU5FH4Q9NIlETM0OwDECYSlf5bKTSRkGyrXE+2w75YUCQ=="
"version": "5.0.0-beta5",
"resolved": "https://registry.npmjs.org/aframe-state-component/-/aframe-state-component-5.0.0-beta5.tgz",
"integrity": "sha512-tv/Fk63fadB1Slwztj0rBpMTwymivsu4XnoA6NswBvVwauLuWvW/06L6aoz+GPiykl6S3GuLi7gDyaqG/wNXng=="
},
"aframe-super-keyboard": {
"version": "2.0.2",

View File

@@ -13,7 +13,9 @@ AFRAME.registerSystem('play-sound', {
},
playSound: function (sound, volume) {
this.createPool(sound, volume);
if (!this.pools[sound]) {
this.createPool(sound, volume);
}
this.pools[sound].play();
this.lastSoundPlayed = sound;

View File

@@ -52,12 +52,14 @@
<a-entity id="camera" position="0 1.6 0.5" camera look-controls wasd-controls></a-entity>
<a-entity id="leftHand"
saber-controls="hand: left"
haptics="events: mouseenter; dur: 35; force: 0.075"
proxy-event__pause="event: menudown; to: a-scene; as: pausegame"
proxy-event__pauserifta="event: abuttondown; to: a-scene; as: pausegame"
proxy-event__pauseriftb="event: bbuttondown; to: a-scene; as: pausegame"
bind__saber-controls="bladeEnabled: !menu.active"></a-entity>
<a-entity id="rightHand"
saber-controls="hand: right"
haptics="events: mouseenter; dur: 35; force: 0.075"
proxy-event__pause="event: menudown; to: a-scene; as: pausegame"
proxy-event__pauseriftx="event: xbuttondown; to: a-scene; as: pausegame"
proxy-event__pauserifty="event: ybuttondown; to: a-scene; as: pausegame"