samedi 30 mai 2015

mouseclick sometimes fails to work

i used an eventlistener for MouseEvent.CLICK. If I click once, it sometimes wont shoot, but when I click again it shoots. Is this a problem within flash or my mouse? It's strange. Heres the code for my fire event.

function fire(m: Event)
        //reset the cooldown
        //spawn a bullet
        //set the position and the rotation of the bullet
            b.rotation = turret.rotation;
            b.x = turret.x;
            b.y = turret.y;
            //add the bullet to the parent object

Aucun commentaire:

Enregistrer un commentaire