User Tag List

Results 1 to 10 of 10

Thread: How to make an enemy appear randomly at locations?

  1. #1
    No Products Registered

    Join Date
    Apr 2011
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to make an enemy appear randomly at locations?

    Alright, basically I need a way to let an enemy appear randomly in set intervals at set locations. It should be as random as possible, thanks alot!

  2. #2
    Clicker Fusion 2.5 Developer

    Join Date
    Jul 2008
    Location
    UK
    Posts
    1,393
    Mentioned
    16 Post(s)
    Tagged
    0 Thread(s)

    Re: How to make an enemy appear randomly at locations?

    Put an invisible "spawn_point" object (ie. an active object) at each of the set locations, and then just say:

    + Every <whenever>
    + Pick one Spawn_Point at random
    -> Create Enemy at 0,0 from Spawn_Point

  3. #3
    Clicker Multimedia Fusion 2

    Join Date
    Sep 2007
    Location
    Poland
    Posts
    232
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to make an enemy appear randomly at locations?

    Or easier:
    * Every 1 second
    -> Create enemy at -22, -55.
    -> Enemy-> Set position to X: random(640)
    -> Enemy-> Set position to Y: random(480)

  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: How to make an enemy appear randomly at locations?

    I use MuddyMole's coding on my games. Grim...an enemy could find itself in a rock with your way, and there is more control for the coder the other way IMHO.

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

  5. #5
    No Products Registered

    Join Date
    Nov 2009
    Posts
    327
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to make an enemy appear randomly at locations?

    i use a technique similar to Muddy Mole,

    i create an invisible active and change its coordinates to random x y, every 0.01 seconds

    and create object @ location of active, whenever you want

  6. #6
    No Products Registered

    Join Date
    Apr 2011
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to make an enemy appear randomly at locations?

    Thanks alot to MuddyMole! You've helped me out, thank you very much!

  7. #7
    Clicker Multimedia Fusion 2

    Join Date
    Sep 2007
    Location
    Poland
    Posts
    232
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to make an enemy appear randomly at locations?

    Quote Originally Posted by nivram
    I use MuddyMole's coding on my games. Grim...an enemy could find itself in a rock with your way, and there is more control for the coder the other way IMHO.

    Marv
    It's not really hard to prevent this. You can simply use flags with my example. I used my system many times.

    * Every 1 second
    -> Create enemy at -22, -55.
    -> Enemy-> Set position to X: random(640)
    -> Enemy-> Set position to Y: random(480)

    * Enemy-> Flag 0 is off
    * Enemy-> Overlapping with rock, stone, wall, whatever
    -> Enemy-> Set position to X: random(640)
    -> Enemy-> Set position to Y: random(480)

    * Enemy-> Flag 0 is off
    * (negate) Enemy-> Overlapping with rock, stone, wall, whatever
    -> Enemy-> Set flag 0 on

    Or you can use better loops and give objects' IDs by spreading values, this would be the best way.

  8. #8
    Clicker Multimedia Fusion 2

    Join Date
    Apr 2011
    Posts
    23
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to make an enemy appear randomly at locations?

    I use muddyHole's method, but i make the active a bouncing ball set at blazing speeds and with full randomness.

  9. #9
    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: How to make an enemy appear randomly at locations?

    Well Grim, now your code is not simpler. There are many ways to do the same thing in MMF. If I may suggest, that we each pick what works best for us and go on helping other forum members.

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

  10. #10
    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: How to make an enemy appear randomly at locations?

    Locked by request.
    _____________________________________________
    Nivram's Examples -Need extensions? Send me a PM.-


Similar Threads

  1. Able to randomly make a character move towards player one?
    By koltzc in forum Multimedia Fusion 2 - Technical Support
    Replies: 17
    Last Post: 7th February 2013, 12:52 AM
  2. Make Enemy/Item Databases
    By Prowl in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 21st December 2009, 08:30 PM
  3. How to make NPCs move randomly throughout a maze
    By RickyRombo in forum Multimedia Fusion 2 - Technical Support
    Replies: 12
    Last Post: 9th September 2009, 11:59 AM
  4. How do you make an enemy that falls off platforms?
    By Jocastus in forum Multimedia Fusion 2 - Technical Support
    Replies: 7
    Last Post: 3rd May 2009, 12:45 AM
  5. How do I make enemy movements like AI?
    By Scooter in forum The Games Factory 2 - Technical Support
    Replies: 11
    Last Post: 28th November 2007, 07:23 AM

Posting Permissions

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