Jerking in move
Posted: Fri Sep 27, 2019 12:42 pm
Hi!
I check the movement of the image by pressing the second button of the mouse.
I do not understand why the image moves with jerks.
How to make the movement more smooth?
aangle = math.atan2(self.destY - self.y, self.destX - self.x)
dist = math.sqrt((self.destX - self.x)^2 + (self.destY - self.y)^2)
self.x = self.x + math.cos(aangle)*self.speed*dt
self.y = self.y + math.sin(aangle)*self.speed*dt
Thanks for your help!
I check the movement of the image by pressing the second button of the mouse.
I do not understand why the image moves with jerks.
How to make the movement more smooth?
aangle = math.atan2(self.destY - self.y, self.destX - self.x)
dist = math.sqrt((self.destX - self.x)^2 + (self.destY - self.y)^2)
self.x = self.x + math.cos(aangle)*self.speed*dt
self.y = self.y + math.sin(aangle)*self.speed*dt
Thanks for your help!