How to create rolling counter number?

Godot Version

4.3

Question

Look at the score in the video, it updates constantly instead of setting itself to the final value. How do I do that in Godot 4?

The digits are on a tall thin sprite with numbers 9 through to 0. The sprite is being moved up. If you time the first sprite movement to be 10 seconds, when it reaches the end of the movement the next counter is rolled on by 1, by shifting it’s position by 10 pixels.

It’s a nice affect actually. I might use it!

Paul

PS I suppose this might not be the most accurate timer, but it really does not have to be, as long as it is consistent.

PSS Actually you may need 9,8,7,6,5,4,3,2,1,0,9 and on the roll to the second nine is when you reset back to the first one.

Edit: Oh I thought it was a timer, but you said it was a score. On thinking about this you could just as easily do it with individual digit sprites, instantiating the next one below, rolling both up and wrapping on 0 back to using the 9 again. That would mean you are only masking one digit size above and below.

1 Like

Thanks, I will think about scroll the sprite from 0-9 up to the score area.