User Tag List

Results 1 to 6 of 6

Thread: Line of sight

  1. #1
    No Products Registered

    Join Date
    Oct 2007
    Posts
    92
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Line of sight

    I'm working on an AI engine for my game and I want the enemy to only move towards the player when it can see it, I have heared of line of sight and I think it is exactly what I need. Could someone give me an example of how to use it?

  2. #2
    Forum Moderator Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleSWF Export Module
    Stephen's Avatar
    Join Date
    Aug 2008
    Location
    Montana
    Posts
    4,515
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: Line of sight

    You would need to use the Advanced Direction Object, and compare the distance between the player and enemies. Then run a loop to make sure that there are no obstacles between the player and the enemy.

    stephen1980
    _____________________________________________
    Nivram's Examples -Need extensions? Send me a PM.-


  3. #3
    No Products Registered

    Join Date
    Oct 2007
    Posts
    92
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Line of sight

    im confused how does the loop tell if there are obstacles?

  4. #4
    Forum Moderator

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleXNA Export ModuleInstall Creator Pro
    nivram's Avatar
    Join Date
    Jul 2006
    Location
    Bandon, Oregon
    Posts
    6,773
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)

    Re: Line of sight

    A simple reverse method, maybe, would be have your enemy shoot a detector towards the character, and if it hits the character, have the enemy attack. I know that is an older method, but works.

    Marv
    ​458 TGF to CTF 2.5+ Examples and games
    http://www.castles-of-britain.com/mmf2examples.htm

  5. #5
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module
    RickyRombo's Avatar
    Join Date
    Mar 2008
    Location
    Somewhere between here and there
    Posts
    3,167
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Line of sight

    Theres also a tut on the dailyclick somewhere about the "last" line of sight method. It's very good. I can't provide a link

  6. #6
    No Products Registered

    Join Date
    Mar 2007
    Location
    Sydney, Australia
    Posts
    1,369
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Line of sight

    Here are a few interesting articles describing Line of Sight further:
    http://www.create-games.com/article.asp?id=1761
    http://www.create-games.com/article.asp?id=1620
    http://www.create-games.com/download.asp?id=7524

Similar Threads

  1. Line of Sight example
    By Ryan in forum File Archive
    Replies: 4
    Last Post: 30th August 2010, 05:27 AM
  2. Line of Sight
    By Panchos in forum Multimedia Fusion 2 - Technical Support
    Replies: 14
    Last Post: 29th August 2010, 11:36 AM
  3. line of sight
    By willow in forum Multimedia Fusion 2 - Technical Support
    Replies: 19
    Last Post: 14th July 2010, 06:10 PM
  4. Line of sight
    By Beginier in forum File Archive
    Replies: 4
    Last Post: 24th June 2009, 05:40 PM

Posting Permissions

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