View Single Post
  #2  
Old 07-20-2010, 08:02 PM
Loriel Loriel is offline
Somewhat rusty
Loriel's Avatar
Join Date: Mar 2001
Posts: 5,059
Loriel is a name known to allLoriel is a name known to allLoriel is a name known to allLoriel is a name known to all
Quote:
Originally Posted by Jiroxys7 View Post
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.
Reply With Quote