A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Help with "Line of sight" script

  1. #1
    Junior Member
    Join Date
    Apr 2002
    Posts
    21
    Is it possible to write a script doing this:

    Draw a line from x,y to x,y
    convert the line to a MC with visibility=0
    apply another script to this MC (using "call" ?)

    Anyone got a URL to a tutorial abouth this?

    Will be used to see if enemy got a "line of sight" vs. player.


    /Shoglic.

  2. #2
    Elvis...who tha f**k is Elvis? phreax's Avatar
    Join Date
    Feb 2001
    Posts
    1,836
    Hmm...you need to freshen up on the trig, cuz that's what you're gonna need to do this! I am sure that one of the guys around have that handy little code around... since I don't even have flash here, I can't be of much help! All I can tell you is that what you want to do is calculate the angle instead! You can't make an MC out of the calculations but you can tell the enemy to shoot if the angle's right! Good luck

  3. #3
    Junior Member
    Join Date
    Apr 2002
    Posts
    21
    Thanx for your reply.

    I have got the other code, but to me it makes no sense, I have implemented it, but do not like code that I do not understand.(I am more into graphics than scripting)


  4. #4
    Elvis...who tha f**k is Elvis? phreax's Avatar
    Join Date
    Feb 2001
    Posts
    1,836
    Oh you're gonna love scripting oce you get into it Post the code, and let someone comment it...that way you'll get a good picture of what does what exactly and that way you'll be able to implement it better

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