User Tag List

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 19

Thread: How to make an enemy shoot directly at the player?

  1. #1
    Clicker Multimedia Fusion 2
    Fusion 2.5 (Steam)

    Join Date
    Oct 2011
    Location
    Oregon
    Posts
    127
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to make an enemy shoot directly at the player?

    I put some turrets into the game I'm making, and I want it to fire directly at the player, but it only fires in 8 directions, so if you run at it from the wrong angle, it won't be able to hit you. How can I fix that?

  2. #2
    Clicker

    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,698
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)

    Re: How to make an enemy shoot directly at the player?

    I have more than one open source examples on my website of 360 degree shooting on my website. maybe one will help.

    Marv
    ​455 MMF2 & CTF 2.5 Examples and games
    http://www.castles-of-britain.com/mmf2examples.htm

  3. #3
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    KLiK-iT's Avatar
    Join Date
    Sep 2011
    Location
    New Jersey
    Posts
    2,862
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Re: How to make an enemy shoot directly at the player?

    Quote Originally Posted by LemonyLime
    I put some turrets into the game I'm making, and I want it to fire directly at the player, but it only fires in 8 directions, so if you run at it from the wrong angle, it won't be able to hit you. How can I fix that?
    Can you upload the file? Post a link to it here and I'll fix it and send it back and you can see how it's done in the event editor.

  4. #4
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    KLiK-iT's Avatar
    Join Date
    Sep 2011
    Location
    New Jersey
    Posts
    2,862
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Re: How to make an enemy shoot directly at the player?

    Marv,.I just checked out your 360 Movement and Shoot Example engine (page 8). You are a math wiz for sure. Nice job....!!

  5. #5
    Clicker Multimedia Fusion 2
    Fusion 2.5 (Steam)

    Join Date
    Oct 2011
    Location
    Oregon
    Posts
    127
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to make an enemy shoot directly at the player?

    It says I need the Advanced Direction Extension to open the Turret Follow Mouse Example (I'm hoping I can substitute the player in place of the mouse.) but I can't find it anywhere. It's not on the wiki list.

    And all the extensions I've found so far don't work with TGF2, only MMF2.

  6. #6
    Clicker

    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,698
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)

    Re: How to make an enemy shoot directly at the player?

    Oh crap. That's right you can't use the 360 example, as it is, in TGF. Really sorry about that.

    Check out this example:
    Character 360 Direction Example

    It is on page 19. Maybe you can adapt that.

    Marv
    ​455 MMF2 & CTF 2.5 Examples and games
    http://www.castles-of-britain.com/mmf2examples.htm

  7. #7
    Clicker Multimedia Fusion 2
    Fusion 2.5 (Steam)

    Join Date
    Oct 2011
    Location
    Oregon
    Posts
    127
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to make an enemy shoot directly at the player?

    Okay, I got it... I think it may be a bit beyond my abilities though, after a quick glance at it, but I'll give it a shot in the morning.

    Thanks for your help.

  8. #8
    Clicker Multimedia Fusion 2
    Fusion 2.5 (Steam)

    Join Date
    Oct 2011
    Location
    Oregon
    Posts
    127
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to make an enemy shoot directly at the player?

    I've mostly figured it out, but I'm not sure if this actually will do what I'm wanting.

    I need the object to fire bullets directly at where the player is when the bullet is fired, not actually follow him completely.

    This would be great for homing missiles or something though.


    I guess just I need a version of this that sets the direction of the turret, rather than the angle. The same formula with direction, doesn't work.

  9. #9
    Clicker The Games Factory 2

    Join Date
    Oct 2011
    Posts
    54
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to make an enemy shoot directly at the player?

    all you need to do is:

    make a large active object, (red circle i use)

    at start of frame make this object invisable.

    then for an event do this.

    if (player) collides with (large active object)
    have (large active object) launch (bullet) in direction of player relative to x0, y0.

    ((then click in the corner it will say 1+1.))

  10. #10
    Clicker Multimedia Fusion 2
    Fusion 2.5 (Steam)

    Join Date
    Oct 2011
    Location
    Oregon
    Posts
    127
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to make an enemy shoot directly at the player?

    That only makes it fire in 16 directions, I need it to fire in a full 360 directions, so it's perfectly accurate.

Page 1 of 2 1 2 LastLast

Similar Threads

  1. How to make shoot-effect in MMF2!!!!! PLEASE HELP!!!!! ;D
    By Sphotof in forum Multimedia Fusion 2 - Technical Support
    Replies: 7
    Last Post: 11th November 2012, 12:26 AM
  2. How to make a rotating cannon shoot?
    By FlinkGigitty in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 16th April 2010, 12:45 PM
  3. How do I make this smiley shoot in right way?
    By FlinkGigitty in forum File Archive
    Replies: 1
    Last Post: 4th February 2010, 09:20 PM
  4. How can I make my character shoot?
    By Davidddd in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 21st April 2008, 03:12 AM
  5. How do I make the character shoot
    By cosmicco in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 23rd October 2007, 10:45 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
  •