User Tag List

Results 1 to 7 of 7

Thread: Independent Health Bars

  1. #1
    No Products Registered

    Join Date
    Dec 2013
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Independent Health Bars

    I am creating a game that has multiple of the same active object that each have their own health. I know how alterable values work and I can get my main character to shoot and kill the enemies with 5 shots by subtracting 1 from the enemies alterable value each time a bullet collides with that particular enemy. I would like to create a health bar for each of these enemies, but I do not want to create multiple of the same active object or health bar.

    Basically, what I'm looking for is a health bar that constantly sets its position to the enemy's position (it scrolls with the enemy above his head), and directly reflects the alterable value A of each enemy.

    Ultimately, the effect would be that each enemy has their own health bar that begins at 5 and ends at 0, which destroys the enemy (and their respective health bar).

    How do I do this?

    Thanks in advance,

    -Zack

  2. #2
    Clickteam Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform 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)
    BartekB's Avatar
    Join Date
    Aug 2013
    Posts
    667
    Mentioned
    14 Post(s)
    Tagged
    0 Thread(s)
    Always > Destroy health bar , start forEach loop of ENEMY 'HPBars'
    On loop of ENEMY 'HPBars' > Create Health bar at ENEMY's pos , set health bar current value to ENEMY's Alterable value 'Health'

    EDIT: If you don't have fusion 2.5, you could do fastloop with spread ID's, replacing foreach loops
    - BartekB, a.k.a Uppernate
    Join the Click Converse Discord! - https://discord.gg/R3WuvF3mHr

  3. #3
    Clicker

    Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCHTML5 Export ModuleiOS Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)Universal Windows Platform Export Module (Steam)
    ratty's Avatar
    Join Date
    Apr 2012
    Posts
    1,165
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)

    Independent Health Bars

    Is the destroy part of that essential? Will that sort of loop on man enemies cause bad performance.

  4. #4
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleSWF Export Module
    happygreenfrog's Avatar
    Join Date
    May 2011
    Location
    I.L.T.D.O.I.R (I.L.T.D.O.I.R's Location: The Dimension Of Infinite Recursion)
    Posts
    4,307
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    ForEach loops? Not much performance issues there. Fastloops? Oh yeah, totally.

  5. #5
    Clickteam Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform 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)
    BartekB's Avatar
    Join Date
    Aug 2013
    Posts
    667
    Mentioned
    14 Post(s)
    Tagged
    0 Thread(s)
    If you have a better idea, which you may have, suggest it. Atleast I'm trying to suggest and be helpful, not being sarcastic and critical. Ratty done it right, but you, you didn't help at all, neither the OP or me.
    I did not know that it will cause bad performance. Now I know, sorry for my mistake. But still you did not help anyone yet.
    - BartekB, a.k.a Uppernate
    Join the Click Converse Discord! - https://discord.gg/R3WuvF3mHr

  6. #6
    Clicker Fusion 2.5iOS 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)
    SolarB's Avatar
    Join Date
    Feb 2012
    Location
    Melbourne
    Posts
    904
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    You can do this without any loops using mmf's automatic object pairing. See Chris B's tutorial here:

    http://www.diybandits.com.au/MMF/art...icpairing.html

    All you have to do is create as many health counters as there are enemies and then do:

    Always
    --> set counter position to 0,0 of active
    --> set counter to health of active

    Health of active is 0
    +Pick one health counter at random
    --> destroy active, destroy health bar

  7. #7
    Clickteam Clickteam
    Danny's Avatar
    Join Date
    Aug 2007
    Location
    United Kingdom
    Posts
    3,016
    Mentioned
    21 Post(s)
    Tagged
    2 Thread(s)
    Even ChrisB's tutorial is too much. You can do it by just creating both objects in the same event and doing:

    Always: Set Position (Relative to Parent).

    No need for a health check/destroy action, MMF can do this automagically too. New guides coming shortly!

Similar Threads

  1. Individual enemy health bars
    By Tabi in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 27th August 2012, 09:26 PM
  2. Enemy Health Bars for DriftingFable
    By LB in forum File Archive
    Replies: 0
    Last Post: 30th April 2010, 12:53 AM
  3. Spreading health bars on enemies
    By Bernardo3D in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 8th October 2009, 01:27 AM
  4. health bars
    By Typhoon in forum The Games Factory 2 - Technical Support
    Replies: 6
    Last Post: 8th December 2007, 09:03 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
  •