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.