Good call!
Here is the counter fix I put in. I think it works!
/*ASSOCIATE KEYDOWN WITH FIRING MISSILES*/
var IDCount = 0;
$(document).keydown(function(e){
//if(!gamestate.gameOver && !gamestate.playerHit){
switch(e.keyCode){
case 75: //this is shoot (k)
var playerposx = $("#player").x();
var playerposy = $("#player").y();
//var name = "playerMissle_"+Math.ceil(Math.random()*1000);
var name = "playerMissle_"+IDCount++;
$("#grouppmissile").addSprite(name,{animation: missile.player, posx: playerposx + 90, posy: playerposy + 14, width: 36,height: 10});
$("#"+name).addClass("playerMissiles");
console.log($("#"+name));
break;
}
//}
});
It looks like you're new here. If you want to get involved, click one of these buttons!