How do I sync timer with a progress bar.

Get help using Construct 2

Post » Sun May 03, 2015 6:36 am

Is there a way for me to sync a timer to a progress bar? What I want to do is I click a button to activate said progress bar and countdown timer starts while also increasing progress on the progress bar.
B
34
S
19
G
3
Posts: 22
Reputation: 4,437

Post » Sun May 03, 2015 9:00 am

The easiest timer I have seen is to use system-every 1 seconds-add 1 (to global time variable). So for a count down you could set time variable to your amount and use subtract 1 every 1 second.

In your every 1 second event just have it add 1 (or 3,5,10.. whatever looks right) to width of your progress bar sprite.
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 » Sun May 03, 2015 9:42 am

Thanks, will try this one out!
B
34
S
19
G
3
Posts: 22
Reputation: 4,437

Post » Sun May 03, 2015 11:12 am

Here's a very basic timer example.

simple-countdown-timer-minutes-seconds_t87831?

using the time remaining in seconds global variable to set the width of your progress bar would do the trick.
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

Post » Mon May 04, 2015 5:17 am

Thanks both to chrisinfinger & LittleStain! It was fun figuring it out on my own, but I'm grateful I had somewhere to start.:)
B
34
S
19
G
3
Posts: 22
Reputation: 4,437


Return to How do I....?

Who is online

Users browsing this forum: Felipiwi and 18 guests