Skip to content

Commit

Permalink
fix wind start
Browse files Browse the repository at this point in the history
  • Loading branch information
supereggbert committed Sep 1, 2019
1 parent ff61b4f commit 0adc944
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
Binary file modified dist/build.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion dist/index.html

Large diffs are not rendered by default.

9 changes: 8 additions & 1 deletion src/app/BulletsComponent.js
@@ -1,5 +1,5 @@
import Bullet from './Bullet.js';
import {Boom,Shoot} from './player.js';
import {Boom,Shoot,Wind} from './player.js';
import {Bow} from './Arrow.js';

AFRAME.registerComponent('bullets', {
Expand Down Expand Up @@ -33,16 +33,23 @@ AFRAME.registerComponent('bullets', {
bow.position.y=-0.07;
bow.scale.set(0.15,0.15,0.15);
this.data.source.setObject3D('bow', bow);
var started=false;

var fire=(e)=>{
this.fire();
if(!started){
setTimeout(Wind,1000);
started=true;
}
}
document.addEventListener("click",fire);
document.addEventListener("mousedown",fire);
document.addEventListener("touchstart",fire);
document.addEventListener("keydown",fire);
document.getElementById("hand").addEventListener("triggerdown",fire);



},
fire:function(){
//if(!this.data.source) return;
Expand Down
4 changes: 2 additions & 2 deletions src/app/main.js
Expand Up @@ -11,14 +11,14 @@ import './GetbowComponent.js'
import './StoryComponent.js'
import './CameracorrectComponent.js'
import './gradient.js'
import {Wind} from './player.js'
/*import {Wind} from './player.js'
var started=false;
document.addEventListener("click",function(){
if(!started){
Wind();
started=true;
}
});
});*/



0 comments on commit 0adc944

Please sign in to comment.