views:

42

answers:

2

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?

Basically I need a way of keeping my automata loop running at 1/30th of a second.

A: 

There's no way for you to control the timing (have a read up here for more info), but without some more info I'm afraid I can't help you more.

Martyn
A: 

It seems useing set interval instead of a self invoking function with setTimeout sped thing up quite a bit. thanks bobince

Robert Hurst