I have a sprite with an UpdateHandler that can change it's position every 0.1 seconds.
My Question is , given the Sprites current position, how can I move it to another position(like from 10,10 to 250,250).
I found out the rotation angle for my sprite like this:
double alfa = (float) Math.atan2(endY - startY, endX - startX) * 180 / PI;
And an example of moving the position is:
sprite.setPosition(sprite.getCurrentX()+1, sprite.getCurrentY());
This would move my sprite every 0.1 seconds to the right. I need to make it work between any 2 points.
Thanks!