User Tag List

Results 1 to 3 of 3

Thread: When I attack an enemy, all their HP bars decrease at the same time.

  1. #1
    No Products Registered

    Join Date
    Jan 2016
    Location
    Adelaide
    Posts
    18
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    When I attack an enemy, all their HP bars decrease at the same time.

    I've seen a lot of articles on instancing, and I've taken them on board, but it never works out for me.
    Fusion tends to decide what it wants to instance, and that's the end story. So I need to understand it better.

    I have x amount of enemies.
    For each enemy, create 1 health bar.
    Every time attack hits enemy, let the health bar equal Enemy.[AlterableValue "Health_"]
    If Enemy.[AlterableValue "Health_"] is equal to 0, destroy the enemy.

    Every time I hit an enemy, its "Health_" AV decreases, and if it reaches 0, THAT enemy will die.
    However, ALL the HP bars of EVERY enemy on screen will deplete at the same time.
    If an enemy dies, the HP bars just reset to the total Enemy HP.

    I've used a For Each loop in the way that I know how to instance, but it's just not working.
    Any suggestions?

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid 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)
    Popcorn's Avatar
    Join Date
    Jun 2006
    Location
    Norway, Bergen
    Posts
    2,367
    Mentioned
    13 Post(s)
    Tagged
    0 Thread(s)
    The easiest way to go about this is to use automatic pairing.

    Number of Healthbars <> Number of Enemies
    - Destroy Healthbars

    Number of Healthbars <> Number of Enemies
    - Create Healthbar at [0,0] from enemy // creates as many healthbars as there are enemies

    Always
    - Healthbar: set position to [0,-30] from Enemy // Autopairing: sets positions for each pair of healthbar / enemy
    - Healthbar: set value to alterable value Health of Enemy //Autopairing: sets values for each pair of healthbar / enemy

  3. #3
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCHTML5 Export ModuleiOS Export ModuleSWF Export ModuleInstall Creator Pro
    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)
    chrilley's Avatar
    Join Date
    Jul 2006
    Posts
    1,013
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    Here's an example of what Popcorn explained above.
    Attached files Attached files

Similar Threads

  1. Best way to go for enemy distance to attack
    By paobrasil in forum Fusion 2.5
    Replies: 12
    Last Post: 30th December 2015, 09:04 PM
  2. How to increase or decrease the score based on the distance of the enemy?
    By daryuss in forum Multimedia Fusion 2 - Technical Support
    Replies: 7
    Last Post: 18th September 2012, 01:33 PM
  3. Individual enemy health bars
    By Tabi in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 27th August 2012, 09:26 PM
  4. Enemy Health Bars for DriftingFable
    By LB in forum File Archive
    Replies: 0
    Last Post: 30th April 2010, 12:53 AM
  5. attack when facing enemy only
    By ionside in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 25th November 2008, 07:38 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
  •