User Tag List

Results 1 to 9 of 9

Thread: why is this destroing all enemys instead of just one?

  1. #1
    No Products Registered

    Join Date
    Oct 2016
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Unhappy why is this destroing all enemys instead of just one?

    Hey ppl! Need your help ... PLEASE T___T
    algorithm.jpg

    why is this destroing all enemys instead of just one?
    it should be only when hp <= 0
    when the destroy enemy was in 22 it killed only one
    already tried with foreach ....

    can anyone help?

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    DaveC's Avatar
    Join Date
    Jun 2007
    Location
    Perth, Australia
    Posts
    2,112
    Mentioned
    13 Post(s)
    Tagged
    0 Thread(s)
    you could try removing that second Collision condition.

    Enemy HP <=0 will suffice as the condition and Fusion will automatically scope and destroy the correct object without the need for the bullet colliding with the enemy condition.

  3. #3
    Clicker Fusion 2.5 DeveloperHTML5 Export ModuleiOS Export ModuleInstall Creator ProUnicode Add-on
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Jul 2006
    Posts
    573
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    The events are getting generalized . Although I don't really see anything wrong there. But you might want to try removing the collision condition from the hp <= 0 event. As the above event would set its HP to 0 or lower eventually making that event true and destroy it without with that condition anyway. Maybe thats whats generalizing it. You could also use the debugger to ensure that all enemies have their own independent values for HP.

    Edit: DaveC beat me to it.

  4. #4
    No Products Registered

    Join Date
    Oct 2016
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi! thanks for your anwsers
    i tried without the collision detection, and tried in a foreach loop it happens the same.... if i move the destroy to line 22 all goes well...
    they have independent hp , all start with 20, if they get hit they get -10 . if one gets hit is hp is 10 and the rest is 20...
    I don't understand this behaviour ...

  5. #5
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Apr 2007
    Location
    Australia
    Posts
    1,151
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Use a For Each loop to check each object individually (see example attached).
    Attached files Attached files

  6. #6
    Clicker Fusion 2.5 DeveloperHTML5 Export ModuleiOS Export ModuleInstall Creator ProUnicode Add-on
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Jul 2006
    Posts
    573
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    What's going on in the bonus loop? If that refers to the enemy that will be causing it.

  7. #7
    Clicker Fusion 2.5Fusion 2.5 Mac
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    zip2kx's Avatar
    Join Date
    Jun 2015
    Posts
    774
    Mentioned
    17 Post(s)
    Tagged
    0 Thread(s)
    A) as the other said, remove the collision event.
    B) I would double check your object values, sometimes i miss to either change the value or set the correct amount. Is your HP set at 20? Is the Damage of the ship at 10 or -10? etc.

  8. #8
    No Products Registered

    Join Date
    Oct 2016
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    RhysD
    thanks for the example loved the scale effect.

    danworth
    the problem was indeed in bonus loop , but doesn't understand why since the onloop was inactive ... but it's SOLVED

    zip2kx
    it's solved... maybe the problem was calling start loop that doesn't have a onloop ... since when i removed the call to BonusLoop it worked again .... what is strange because line 23 was a copy of line 22 initially -_-

    Thank you all

  9. #9
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    mobichan's Avatar
    Join Date
    Oct 2007
    Location
    Buffalo, NY
    Posts
    3,274
    Mentioned
    26 Post(s)
    Tagged
    0 Thread(s)
    I believe your bonus loop is resetting the object scope. Did you try moving the start loop action to AFTER the destroy action?

Similar Threads

  1. How to spawn random enemys?
    By UnicornMan in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 9th September 2013, 03:54 AM
  2. how do i make it so i can stomp on enemys to kill them?
    By gamebuilder in forum The Games Factory 2 - Technical Support
    Replies: 5
    Last Post: 13th May 2012, 02:10 PM
  3. platefom enemys
    By ChrCha in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 10th May 2011, 12:20 AM
  4. Enemys take damage.
    By Dakk in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 22nd March 2010, 11:09 AM

Tags for this Thread

Posting Permissions

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