Working out an angle

Game Editor comments and discussion.

Working out an angle

Postby akhad » Tue Oct 28, 2008 8:24 pm

I'm trying to get the angle between two points (actually Actor coords). I have one actor set at screen top, middle of the screen.
I then click along the base of the screen at a random X coord and a line is drawn (in the canvas) between the 2 points. I then require a sprite to move along the line,bottom to top. This sprite has a series of anim frames, the seq is of an arrow rotating through 270 degrees to 90 degrees. The movement part is easy, the MoveTo function can do this for one thing. However, I want to get the actual angle the actor will move at, which I will then use to work out which anim frame to set to represent the correct angle of the arrow. Make sense, anyone?
User avatar
akhad
 
Posts: 43
Joined: Tue Jan 16, 2007 1:59 pm
Location: U.K
Score: 0 Give a positive score

Re: Working out an angle

Postby makslane » Tue Oct 28, 2008 11:20 pm

Look the vectoradd tutorial here:
viewtopic.php?f=4&t=5719
Game Editor is an open source game creator software that's wants to pay it's developers to keep evolving.
If you like Game Editor, make a review!
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score


Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest

cron