Firstly, we'll interchange the terms "bullets" and "lasers" for the sake of explanation. It's a space game, so please bear with me.
I want the ship to be able to fire lasers, which can last (currently) 0.5 seconds before destroying themselves if they don't collide with anything.
Furthermore, I want a maximum number of lasers onscreen (call it a reload), and a "reload" time of 2 seconds if there are 5 lasers onscreen. In other words, if the first of five lasers is destroyed, I could fire another one, but no more than 5 onscreen. And if I fire 5, there is a reload time of 2 seconds.
If the above wasn't clear enough, another example: I fire four lasers. I can fire 1 more and there are 5 and then there is a 2 second reload time, but if the first lasers is destroyed then I can fire 2, and so on. Fire - bullets on screen increase by 1; destroyed - bullets on screen decrease by 1.
So this is what I have thus far, but it does not work as intended:
Any ideas or pointers? Thanks, regards.