Another relatively simple question I hope.
I have a person object that I move to a point designated by a point on a screen touched by the user.
I would like to have a set speed that the object moves to the position in.
However I am not sure how to do it as every time I calculate it it either has varying speeds or the x origin gets there before the y origin and vice versa.
I would like to be able to move them at the same speed and have them reach the point at the same time.
I hope I have explained this well, if not please ask questions
Thanks in advance
Disco
Another relatively simple question I hope. I have a person object that I move
Share
In your update function, calculate the X and Y distance from point A to point B, and each frame increment the difference by the same fraction rather than a constant value.
i.e.
player.X += difference / frameCount.