Quote:
Originally Posted by Jiroxys7
I'm trying to move the player along an angle from point A to point B using getangle(). However I'm not quite sure how to pull out a set of coordinates that are along that angle. Though I dont suppose there would be any way to somehow use move() on the actual player as an alternative is there?
Any advice?
|
If you know how far you would want to move the guy if it was in a straight horizontal line, say, r tiles, you can get how far to move him for the angle a on both the x and y axis by doing something like dx = r * sin(a); dy = r * cos(a);, you might have to **** with the signs or swap sin and cos depending on where you define a=0 to be, I forgot what getangle() does there.