How do i stop the mouse from shooting my gun when no ammo

Get help using Construct 2

Post » Sun Dec 21, 2014 8:43 pm

I Have a global variable for my ammo and it is set to 10, everytime you press left mouse click it subtracts 1 from the global variable, once it reaches 0 i want it to stop me from being able to click and shoot my weapon and then the player has to wait 2.5 seconds for the gun to reload and after the 2.5 seconds are up it will reset the global variable back to 10 and then you can shoot again. Is this possible? thanks for reading :D
Posts: 1
Reputation: 152

Post » Sun Dec 21, 2014 10:16 pm

Simple, use timer.

event: on mouse left click
subevent: ammo>0 and subevent: on timer "ready",
action: something spawn bullet
subtract 1 from ammo

else: set timer "ready" 2.5 sec once
Posts: 220
Reputation: 1,464

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 10 guests