Skip to content

Commit

Permalink
improved bullet death on boss timing
Browse files Browse the repository at this point in the history
  • Loading branch information
metalx1000 committed Jul 4, 2015
1 parent 57f42bb commit 850c6c4
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions js/weapons.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ function update_weapons(){
||game.time.now > bullet.timeout){
bullet.destroy();
}

if(game.time.now > bullet.explodeTime){
explosion(bullet);
bullet.destroy();
}
});

enemyBullets.forEach(function(bullet){
Expand Down Expand Up @@ -49,10 +54,7 @@ function shot(bullet,object){
object.life-=1;
hit(object);
var delay = Math.floor(Math.random() * 400) + 200;
setTimeout(function(){
explosion(bullet);
bullet.kill();
},delay);
bullet.explodeTime = game.time.now + delay;

}else if(!object.boss){
bullet.kill();
Expand Down

0 comments on commit 850c6c4

Please sign in to comment.