User Tag List

Results 1 to 9 of 9

Thread: Question about Enemy AI

  1. #1
    No Products Registered

    Join Date
    Oct 2008
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question about Enemy AI

    I want my enemy sprites to constantly follow the player. I've been dabbling with this and can't seem to get it to work. Any help you can give would be greatly appreciated!

  2. #2
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module

    Join Date
    Oct 2008
    Posts
    42
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Question about Enemy AI

    We talking topdown, or side view?

  3. #3
    No Products Registered

    Join Date
    Oct 2008
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Question about Enemy AI

    Quote Originally Posted by Jakinbandw
    We talking topdown, or side view?
    Hi!

    I'm talking top-down...

  4. #4
    Clicker Multimedia Fusion 2SWF Export Module
    Jacob's Avatar
    Join Date
    Jul 2007
    Location
    Second pixel to the right
    Posts
    3,208
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Question about Enemy AI

    The simple method, 32dir:
    Set the enemy to a bouncing ball moement and have it always look at the player.
    The advanced method, 360dir:
    Use the advanced direction object to get the angle between the enemy and the player.
    Make the event:

    ------Always-
    ---------set x position to X(" Active" )+Sin(Angle( "Active" ))
    ---------set y position to Y( "Active" )+Cos(Angle( "Active" ))

    EDIT: Alternatively, you could replace the angles with an alterable value and use that instead...

  5. #5
    No Products Registered

    Join Date
    Jun 2006
    Location
    Land of raging rockets
    Posts
    1,231
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Question about Enemy AI

    If this doesn't do, because your level is too complicated, try the pathfinding extension.
    But considering this question, you might not be ready for that yet.

  6. #6
    No Products Registered

    Join Date
    Oct 2008
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Question about Enemy AI

    Quote Originally Posted by DarkeSoft
    The simple method, 32dir:
    Set the enemy to a bouncing ball moement and have it always look at the player.
    The advanced method, 360dir:
    Use the advanced direction object to get the angle between the enemy and the player.
    Make the event:

    ------Always-
    ---------set x position to X(" Active" )+Sin(Angle( "Active" ))
    ---------set y position to Y( "Active" )+Cos(Angle( "Active" ))

    EDIT: Alternatively, you could replace the angles with an alterable value and use that instead...
    You can tell I am new to all this! This 32dir command you mention; is it selectable or must I program it as a variable?

  7. #7
    No Products Registered

    Join Date
    Oct 2008
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Question about Enemy AI

    Maybe if I explain what I am doing for a project this will help clarify the problem. I am creating a shooter with a top-down perspective (like Robotron 2084) and I want the enemy sprites to walk independently, but always follow the direction of the player sprites

  8. #8
    Clicker Multimedia Fusion 2SWF Export Module
    Jacob's Avatar
    Join Date
    Jul 2007
    Location
    Second pixel to the right
    Posts
    3,208
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Question about Enemy AI

    The 32dir just meant that your player could only move in 32 directions. It should be enough for what you want. You just go into the properties and select bouncing ball movement. THen, in the event editor, you just make an event that
    Always
    +look in direction 0,0 from player

  9. #9
    No Products Registered

    Join Date
    Oct 2008
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Question about Enemy AI

    Quote Originally Posted by DarkeSoft
    The 32dir just meant that your player could only move in 32 directions. It should be enough for what you want. You just go into the properties and select bouncing ball movement. THen, in the event editor, you just make an event that
    Always
    +look in direction 0,0 from player
    Sweet! Thank you very much!

Similar Threads

  1. Enemy Question
    By CADMAN in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 27th April 2010, 05:38 AM
  2. Enemy sprite question
    By gamemaster in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 24th March 2009, 08:32 PM
  3. Question about enemy AI
    By gamemaster in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 28th January 2009, 09:58 PM
  4. Question about making my enemy duplicates unique
    By mobichan in forum Multimedia Fusion 2 - Technical Support
    Replies: 7
    Last Post: 5th April 2008, 12:56 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
  •