+ 9
What is use of math.random and loop in animation
How to make an animation by math.random and loop Please give me some examples and teach me by code.
2 Answers
+ 8
Check comments in code
https://code.sololearn.com/WVLuixPFxT8a/?ref=app
+ 6
you cannot make an animation with a simple loop... you need to cyclicly update display in a kind of loop, by regularly but async call function(s) to do the (frame) update (using setInterval, setTimeout or requestAnimationFrame)
Math.random is a function wich return a number between [0; 1[
so it's used to generate random values wich could be used inside animation ^^