hook up beat hit sound

This commit is contained in:
Kevin Ngo
2018-10-11 21:17:34 -07:00
parent 6f3d12d846
commit 7e09031c3e
9 changed files with 34972 additions and 34907 deletions

View File

@@ -421,14 +421,14 @@ AFRAME.registerComponent('beat', {
saberBoundingBox = saberEls[i].components['saber-controls'].boundingBox;
if (!boundingBox || !saberBoundingBox) { break; }
if (saberBoundingBox.intersectsBox(boundingBox)) {
this.el.emit('beathit', this.el);
this.destroyBeat(saberEls[i]);
this.el.sceneEl.emit('beathit', null, false);
break;
}
if (saberBoundingBox.intersectsBox(beatBoundingBox)) {
this.el.emit('beathit', this.el);
this.destroyBeat(saberEls[i]);
this.wrongCut(saberEls[i].getAttribute('saber-controls').hand);
this.el.sceneEl.emit('beatwrong', null, false);
break;
}
}