framerate/dt problem

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
utunnels
Citizen
Posts: 75
Joined: Fri Jan 06, 2012 5:20 pm

Re: framerate/dt problem

Post 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.
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 7 guests