How can I make a steady automata in JavaScript?
Posted
by RobertWHurst
on Stack Overflow
See other posts from Stack Overflow
or by RobertWHurst
Published on 2010-04-26T22:12:20Z
Indexed on
2010/04/26
22:43 UTC
Read the original article
Hit count: 345
I'm working on a JavaScript game and I've got an automata system controlling game time and sprite animation as well as giving a hand to the path finding system for timing and such. My problem is on slow browsers the JavaScript loop I'm using for counting the time is not very accurate. It tends to jump around a lot. I there a way to force the loop to run consistently at 30 fps? The automata can drop frames if it needs to catch up so if the solution requires dropping frames that's ok.
© Stack Overflow or respective owner