User Tag List

Results 1 to 3 of 3

Thread: Enemy Behaviors: Spawning and AI

  1. #1
    Clicker Fusion 2.5 (Steam)Fusion 2.5+ DLC (Steam)

    Join Date
    Jun 2018
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Enemy Behaviors: Spawning and AI

    I'm trying to work out how to implement enemy spawning and behaviors into my game.

    For spawning, I want the enemy to be spawned when its spawner is on-screen and there is no instance of the enemy that corresponds with its specific spawner. When I've tried this, it ends up spawning multiple instances of the enemy if the spawner leaves the screen but the enemy is still visible, which I do not want. Basically I am trying to make spawning work like it did in the old mega man games.

    For its behaviors, I want to be able to specify which instance of an enemy will be affected (since the enemy is just a copy/paste)
    As an example, whenever the player is on the same y-coordinate as the enemy, the enemy speeds up. When I've tried this, it ends up affecting all of the enemies instead of just one.

    With all of that said, what is the best way to go about achieving this?

  2. #2
    Clicker Fusion 2.5Fusion 2.5+ DLC
    Sleepy's Avatar
    Join Date
    Dec 2019
    Posts
    13
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Hi ^^ !
    For the spawners, one method to do this is to have different ID for each spawners and the ennemy created by one spawner share the same ID as this spawners. The spawner can have a value to test if it has already created an ennemy. When both ennemy and spawner with the same ID are off-screen, you can destroy the ennemy, by having the two off-screen you prevent the spawner to create ennemy from the middle of the screen if only the ennemy leave the screen.

    To change the speed of the ennemy, you can define a little margin ( for exemple +-8 pixel ), this way you prevent some case where the player is on the same ground but just 1 or 2 pixel below/above. With a little margin if the player is few platform down/up the speed changer would not be triggered.

    I've tried to make you a little exemple with two differents type of enemies and spawners, this way you can see how to handle the global part of Enemies/Spawners with group and then have your different behaviors.

    MM Spawner Exemple.mfa
    ( i've tried to comment it but i'm not really good at english, i hope it's still understable ^^' )

    Hope it help

  3. #3
    Clicker Fusion 2.5 (Steam)Fusion 2.5+ DLC (Steam)

    Join Date
    Jun 2018
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Sleepy View Post
    Hi ^^ !
    For the spawners, one method to do this is to have different ID for each spawners and the ennemy created by one spawner share the same ID as this spawners. The spawner can have a value to test if it has already created an ennemy. When both ennemy and spawner with the same ID are off-screen, you can destroy the ennemy, by having the two off-screen you prevent the spawner to create ennemy from the middle of the screen if only the ennemy leave the screen.

    To change the speed of the ennemy, you can define a little margin ( for exemple +-8 pixel ), this way you prevent some case where the player is on the same ground but just 1 or 2 pixel below/above. With a little margin if the player is few platform down/up the speed changer would not be triggered.

    I've tried to make you a little exemple with two differents type of enemies and spawners, this way you can see how to handle the global part of Enemies/Spawners with group and then have your different behaviors.

    MM Spawner Exemple.mfa
    ( i've tried to comment it but i'm not really good at english, i hope it's still understable ^^' )

    Hope it help
    Awesome, this worked great! It was just what I was looking for so thanks a bunch!

Similar Threads

  1. I need help with enemy spawning and timers
    By coogart07 in forum Fusion 2.5 Free Version
    Replies: 6
    Last Post: 1st October 2018, 07:23 PM
  2. Need help with creating/spawning more of the same enemy
    By Leyonkungen in forum Developer Services
    Replies: 1
    Last Post: 7th December 2016, 09:40 PM
  3. spawning problem
    By tailsko in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 31st August 2011, 10:56 PM
  4. Enemy spawning help.
    By GameDragon in forum Multimedia Fusion 2 - Technical Support
    Replies: 7
    Last Post: 28th January 2010, 03:12 AM
  5. Enemy placements and spawning in a shooter?
    By CKX in forum Multimedia Fusion 2 - Technical Support
    Replies: 15
    Last Post: 19th February 2009, 02:39 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
  •