Hi. In working on a test project, I have the following groups for "combat" (Space Bar to attack) and health variables for a ship's health and health bar:
<img src="http://s18.postimage.org/9l8rfx5yv/image.png" border="0" />
<img src="http://s18.postimage.org/4nv6ut3zr/image.png" border="0" />
I'd like to add a cooldown system, wherein players can only fire every 3 seconds. My question is how to take advantage of the groups and events I already made. Whereas the health drops in increments (10 per enemy attack/collision), I'd like the second bar to show the max cooldown period (as in, the bar is filled), reduce it to 0 when the gun is fired, then climb back to the top every second as the gun cools off and returns to its original value.
While there are several ways to do cooldown (I've been testing two recently), I'm really not sure how to adapt them to my project. A simple one would be:
<img src="http://s18.postimage.org/646pcy6wn/image.png" border="0" />
Though whether with this or a different one, I wouldn't know where to begin (other than start by writing them).