How do I create a reload system

Get help using Construct 2

Post » Wed Dec 21, 2016 10:32 pm

Hey there!
I need to make a reload system for my game. Right now, you have 6 bullets, and each time you shoot, the variable decreases by 1. For reloading, I wanted to make it so that it reloads each bullet with a 0.5 second delay in between each bullet, and I also want the reloading to stop, in other words not finish, if the player shoots during the reload. Ive tried doing something with while loops, but it really isnt working out... Does anyone have any idea of how this can be achieved?

Will be very grateful for an answer
B
3
Posts: 10
Reputation: 195

Post » Wed Dec 21, 2016 11:55 pm

Hi KreKre,

try this in the loop:

wait 0.5*loopindex
reload the bullet

or try to use timer behavior with 0.5 sec to reload, start the timer again until all reloaded.

Hope this helps,
vargazso
B
19
S
4
Posts: 32
Reputation: 1,044

Post » Thu Dec 22, 2016 9:24 am

Allright, I tried doing that, but it didnt really work out the way I wanted it to. I managed to solve the problem myself now, but it took 40+ events to do so lel.
B
3
Posts: 10
Reputation: 195

Post » Sat Dec 24, 2016 9:34 pm

I know this is a few days late. I made a basic reload system with only 5 Events.

Image

It's pretty basic it uses a bool for the reloading timer. Hope this helps you good luck with your project :D

Example capx https://www.dropbox.com/s/m6t4296vyvvpjgg/reload%20example.capx?dl=0
B
12
S
8
G
3
Posts: 33
Reputation: 3,483


Return to How do I....?

Who is online

Users browsing this forum: jorgmaquoi and 17 guests