I'm having a problem getting my math to work. I'll quickly describe the action that I want to take place: I have one *enemy* movie symbol that I want to go after the *good-guy* movie symbol. In other words, I want the *enemy* to move toward the location of the *good-guy*.
What I know:
1) The x and y coordinates of the *enemy* and the *good-guy*
2) The slope of line between the 2 symbols.
3) The distance I want the *enemy* to move.
What I don't know:
1) How to find the NEW x and y coordinates of the *enemy* as it moves toward the *good-guy*.
Thanks for the help.
To Do This You Have To Create A NEw Movie Clip Symbol And Place It On The Main Timeline Inside That Movie Clip Do The Following
On The First Frame Put
Set Variable enemyx= GetProperty("/enemy",_x)
Set Variable enemyy=GetPropertry("/enemy",_y)
On The Second Frame Put
Go To And Play Frame 1
This Has Just Created A Continuous Loop That Constantly Updates The X And Y Co-Ordiantes Of Your Enemy
If You Want More Help then E-Mail Me!!
Check Out http://www.btinternet.com/~guywatson
Here is An Example I Have Created That Should Help You Alot
Check it Out!!
Click Here to Expand Forum to Full Width
Poll by Flashkit.com