Page 2 of 2

Re: framerate/dt problem

Posted: Sun Feb 12, 2012 3:56 am
by utunnels
Back to topic, I think it has something to do with float calculation (like 100.00000000001 vs 99.99999999999).

Code: Select all

if self.py == math.floor(self.y) and self.px == math.floor(self.x) then
Although you do this check here, but maybe math.round is better?
Or perhaps you should avoid using dt as a parameter, use loop count instead. That is add up dt and when it reach a certain amount, update your scene and increase loop count.