fawdda
1 - Add a cooldown to your fire action. Something like :
Var Cooldown = 0;
On fire event (if Cooldown <= 0) Fire bullet; Set Cooldown to 2;
Every tick (if cooldown > 0) substract dt (delta time) from cooldown.
2 - You can create a sprite behind your bullet at every tick. And destroy this sprite after few secs.
I'm curious about this approach versus using a timer. It basically does the same thing (I beleive), doesn't it? I have an InstanceVar on the player, canShoot set to true. Then when the player shoots, the instancevar gets set to false, and I set a unique timer. When the timer event fires, I set the instancevar back to true. I know the dt is the real time in seconds, whereas the timer would be affected by the fps the game was currently ruuning at. Is this correct? Is the approach you outline here more efficient and optimized than a timer approach that I'm currently using?