A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Math problem with getting movie symbol to follow line

  1. #1
    Senior Member
    Join Date
    Mar 2000
    Posts
    289
    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.
    Kory

  2. #2
    Senior Moderator
    Join Date
    Apr 2000
    Location
    Sheffield, UK
    Posts
    3,881

    Wink

    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!!

  3. #3
    Senior Moderator
    Join Date
    Apr 2000
    Location
    Sheffield, UK
    Posts
    3,881

    Lightbulb

    Check Out http://www.btinternet.com/~guywatson
    Here is An Example I Have Created That Should Help You Alot
    Check it Out!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center