How do I make a score Counter like the HP Counter in Mother

Get help using Construct 2

Post » Sun Aug 24, 2014 10:44 pm

Hello, this is just eyecandy, but i love when you finish an arcade game stage and the score shows itself growing up. Its like the reverse effect of the HP counter in mother 3

Image

So i tried to create a variable called "scorecounter", then create a for cycle from 0 to score-1. Inside the for cycle set the scorecounter text to the variable scorecounter, then add 1 to scorecounter , then substract one from the score.

My problem is that the cycle just shows the final count. Id be happy to listen to new methods ;)
B
3
Posts: 4
Reputation: 179

Post » Sun Aug 24, 2014 11:00 pm

its because the normal loops all finish within one tick so you dont see it counting up.
you can achieve what you want by making it count up one number per tick, make an event like
compare scorecounter is less than score add 1 to scorecounter, this will fire every tick letting the counter go up 1 per tick.
you can pack this event in an inactive group, make an event "on level finished"->set gtoup active and in the group make the above descriped event followed by an "Else"->set group inactive (so it doestn check every tick if scorecounter is less than score)

hope this helps and wasnt to confusing!
if not i will try to explain it better tomorrow (its 1am here)
B
38
S
11
G
5
Posts: 485
Reputation: 5,340

Post » Mon Aug 25, 2014 8:18 pm

my case, I do this by making two vars called for example "Score" and "ShownScore" (a third one for enabling/disabling this event).. just like this screenshot below :

Image

you can do every tick but to make sure you control the speed I recommend using "every X second" event because that'll give a similar result on every machine..

you can also use delta-time (click for the tutorial) but for me I don't like using it when wanting integer results.
B
10
S
1
G
1
Posts: 22
Reputation: 848

Post » Thu Aug 28, 2014 2:37 am

thanks a lot dudes.
B
3
Posts: 4
Reputation: 179

Post » Thu Aug 28, 2014 6:28 am

Ah, damn. @aahmadmanga beat me to it! Though, I do have a follow up question I'm just curious about.

Anyone have a good idea how to animate and program the actual rolling on the number counter? Like, showing the number actually rolling up or down from 1 to 2 like a real counter gauge?

I've been mulling the idea in my head for a long time and the closest I can get is with a wall of mind-numbing events.
B
15
S
4
G
1
Posts: 169
Reputation: 2,179


Return to How do I....?

Who is online

Users browsing this forum: 8tomo8, brunopalermo and 10 guests