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

1 favourites
  • 5 posts
From the Asset Store
Make a displayed number gradually increase or decrease, making an impression of a real-time counting.
  • 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

    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

  • 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)

  • 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 :

    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.

  • thanks a lot dudes.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Ah, damn. 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.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)