How do I make a gun have limited ammo?

Just started using Construct 2? Post your questions here

Post » Tue Jan 05, 2016 2:40 am

I used the beginner tutorial for the top-down shooter and I was wanting to expand off it to see what I can do. When I make a variable called Ammo with a starting number of 7 and display it on the HUD, it works fine, but I can't get to the point where I can check if it has no ammo, and if so, put a timer for reloading if you try to shoot.
B
2
Posts: 2
Reputation: 154

Post » Tue Jan 05, 2016 3:23 am

I would think you'd need to create some variable, let's call it "ammo".
Then, on startup, set ammo to 100.
If (key) pressed AND ammo > 0, then shoot bullet.

Hope this helps!
B
3
Posts: 7
Reputation: 189

Post » Tue Jan 05, 2016 4:37 am

How would I make an if-else statement in construct?
B
2
Posts: 2
Reputation: 154

Post » Tue Jan 05, 2016 12:29 pm

alienchub wrote:How would I make an if-else statement in construct?


Adding a "system else" event would do..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 0 guests