How do you make a simple number increase/decrease effect like Yugioh's LifePoint thingy?
Like from a 4000 LP, it will show up random numbers in a decreasing fashion until it ends up with 0.
You could count down to zero over time. In another event you could use a random value for milliseconds to take the current value and present it.
-Every 5 milliseconds
-Every random(1000) milliseconds
How do I count down to zero? Am I suppose to print a random number while the real values are actually decreasing and will only show the real value once it reaches it designated... value?
Develop games in your browser. Powerful, performant & highly capable.
Try to have 2 variables, one for the shown life point and another with the actual lifepoint.
Updates them when needed, then you can make the shown lifepoint decrease until it reach the actual lifepoint like every frame or every 5ms.