How do I increase the value of a progress bar on keypress?

Get help using Construct 2

Post » Wed Oct 22, 2014 3:51 am

I've been looking around for the answer and I just can't seem to find it. :(
B
3
Posts: 2
Reputation: 179

Post » Wed Oct 22, 2014 4:07 am

Make a rectangular sprite with a width of your "progress" (ie. 1-100%, use 100 pixels width), now simply change the width +1 or -1 each time the key is pressed.. voila magic
Check out my completed games on the Arcade! Capt. Doe Save the Universe! & Clicker Wizard!
B
69
S
18
G
8
Posts: 639
Reputation: 9,549

Post » Wed Oct 22, 2014 4:13 am

chrisinfinger wrote:Make a rectangular sprite with a width of your "progress" (ie. 1-100%, use 100 pixels width), now simply change the width +1 or -1 each time the key is pressed.. voila magic

Thanks!
B
3
Posts: 2
Reputation: 179

Post » Wed Oct 22, 2014 4:19 am

I forgot to add.. this probably won't matter since your updating it by setting it width with an event of keypress, but I will add if you update it via a variable at anytime (like say for a healthbar type use where your setting the width from a heath variable) you will need to make sure to use a set width to (variable) action or it won't visually update.
Check out my completed games on the Arcade! Capt. Doe Save the Universe! & Clicker Wizard!
B
69
S
18
G
8
Posts: 639
Reputation: 9,549


Return to How do I....?

Who is online

Users browsing this forum: Felipiwi and 27 guests