How do I create an ammo counter?

Get help using Construct 2

Post » Wed Oct 15, 2014 9:09 pm

In my game the players to over powered<so i want to add a ammo counter,a way to get ammo,and a way to make it so after they shoot they have to wait to shoot again.Help?
B
6
Posts: 13
Reputation: 278

Post » Wed Oct 15, 2014 9:15 pm

GIve your player 2 variables "ammo" and "cooldown"

when the player spawns, or picks up ammo, set his "ammo" variable to whatever you want.
set to starting value of the cooldown to "2" lets say.

event(3 conditions)
keyboard "on button press "space"
cooldown = 0
ammo > 0

action
create bullet at player.x, player.y
set cooldown to 2

event
every 1 seconds -> player.cooldown -1

This the player can only shoot if the cooldown reaches 0 and has more than 0 ammo
B
87
S
44
G
16
Posts: 1,009
Reputation: 17,946

Post » Wed Oct 15, 2014 9:37 pm

I just need help with the last part,every 1 seconds then what do i do
B
6
Posts: 13
Reputation: 278

Post » Wed Oct 15, 2014 9:46 pm

its a system event, look for it near the bottom

subtract 1 from the players "cooldown" variable.
B
87
S
44
G
16
Posts: 1,009
Reputation: 17,946

Post » Wed Oct 15, 2014 9:57 pm

i did subtract from cooldown 1 for every second and now i cant shoot
B
6
Posts: 13
Reputation: 278

Post » Wed Oct 15, 2014 10:47 pm

..maybe something like this ...
You do not have the required permissions to view the files attached to this post.
B
67
S
24
G
7
Posts: 1,518
Reputation: 11,072


Return to How do I....?

Who is online

Users browsing this forum: Yahoo [Bot] and 20 guests