How do I make a bar that slowly fills up?

Get help using Construct 2

Post » Sun Feb 15, 2015 6:53 am

I'm making a top down shooter, and attached an area-of-effect attack to the RMB. However, it is spammable by clicking rapidly.
I want to have a progress bar slowly fill up, and when it's full make the attack available. When the attack is used, the bar resets, and starts regenerating.
How do I do this?
B
4
Posts: 8
Reputation: 216

Post » Sun Feb 15, 2015 7:41 am

I would make that in this way:

Flashing is just to see if it works
You do not have the required permissions to view the files attached to this post.
B
6
S
1
Posts: 3
Reputation: 362

Post » Sun Feb 15, 2015 9:49 am

Can you explain how this works? What is weapon_cooldown?
B
4
Posts: 8
Reputation: 216

Post » Sun Feb 15, 2015 9:59 am

Okay the first part is
Image
When the mouse is clicked it checks if the recharge is done. If so it that triggers the flash and subtract the recharge by 20 making it 0 again ( i would change it to set )

Image

Line 2 is basicly every 0.25 secounds if the recharge is less then 20(not done) then it adds 1 to the recharge.

Line 3 is displaying the recharge.

Thanks to @Bburg800 for the capx example. Any question feel free to contact me.
B
10
S
1
G
1
Posts: 57
Reputation: 828

Post » Sun Feb 15, 2015 10:46 am

you will need Rex cooldown plugins for this
B
218
S
31
G
14
Posts: 1,890
Reputation: 37,701

Post » Sun Feb 15, 2015 10:47 am

Thanks I got it working, but there are still some bugs
The bar only fills up halfway before stopping, and I can still fire as many times as I want

Edit: Nvm about the bar filling up, but I can still fire as many times as I want. I want it so you can only shoot once, when the bar is full.
B
4
Posts: 8
Reputation: 216

Post » Sun Feb 15, 2015 10:58 am

Then add a check at your firing code, if you should already be able to shoot
- as soon as the bar is full, set a boolean instance variable (for example: Bar_full set true)
- if the bar is empty, set this boolean variable to false

and then add in your firing code another AND check.
If Bar_full set true
- you can shoot
B
33
S
8
G
3
Posts: 134
Reputation: 2,772

Post » Sun Feb 15, 2015 11:11 am

What do you mean by check?
B
4
Posts: 8
Reputation: 216

Post » Sun Feb 15, 2015 11:18 am

a simple and event

an and event is just a normal "add" event. that's it.

it would be easier to help you if you could include your .capx file.
B
33
S
8
G
3
Posts: 134
Reputation: 2,772

Post » Sun Feb 15, 2015 11:29 am

Everytime I try to add it as an attachment, the page refreshes and it never uploads. Ill try to do it through google docs just pm me your email
B
4
Posts: 8
Reputation: 216

Next

Return to How do I....?

Who is online

Users browsing this forum: Bobbyneal100 and 1 guest