User Tag List

Results 1 to 5 of 5

Thread: Plants Vs. Zombies Style Game - Health bar question

  1. #1
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    Puff_N_Stuff's Avatar
    Join Date
    Apr 2009
    Location
    Stuart, FL. USA
    Posts
    51
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Plants Vs. Zombies Style Game - Health bar question

    We are developing a Plants Vs. Zombies grid defense style game. We want the "characters" that move to have there own health bar using the counter object. The problem is that when any of the characters gets hit all the health bars go down. We need to have an independent health bar for each object. We could do this by cloning the counter object and the character's active but it is my understanding that when you clone an active it also duplicates all the graphics and therefore increases the memory used. Since we are talking about dozens of cloned animated characters on or off the screen, that would use a lot of memory.

    What I was thinking is to use duplicate objects but assign alterable values to each one as they colide with a detector off screen but when I started to map it out my brain when to mush. Does anyone have an idea of how to do this?

    Again to clearify, we need to have duplicate actives (not cloned) with their own health bar(counter). The health bar will lock to the position of the character as it moves across the screen using: Always--->Set Position of "Coouter" relative to "Active"

  2. #2
    Clicker Multimedia Fusion 2 DeveloperiOS 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)
    King_Cool's Avatar
    Join Date
    Aug 2008
    Posts
    2,335
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Give all your Character/ Enmy Objects an AlterableValue called Health_
    Give all your Character/ Enmy Objects an AlterableValue called MaxHealth_
    When damage is delivered ( through a Collission or Overlap event ), subtract from Enemies Health_

    Event Editor, do 3 Events:

    If number of HealthBars is lower than number of Enemies
    --> Create HealthBar at 0,0

    If number of HealthBars is greater than number of Enemies
    + Pic a HealthBar at random
    --> Destroy HealthBar

    Allways
    --> Set HealthBar possition to Enemy possition
    --> Set HealthBar maxValue to Enemy MaxHealth_
    --> Set HealthBar value to Enemy Health_

  3. #3
    Clicker Multimedia Fusion 2SWF Export Module
    Jacob's Avatar
    Join Date
    Jul 2007
    Location
    Second pixel to the right
    Posts
    3,208
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You should do the above, but for future reference, MMF won't duplicate identical images in its cache. Even if they belong to completely different objects, it will only store it once.

  4. #4
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    Puff_N_Stuff's Avatar
    Join Date
    Apr 2009
    Location
    Stuart, FL. USA
    Posts
    51
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by King_Cool View Post
    Give all your Character/ Enmy Objects an AlterableValue called Health_
    Give all your Character/ Enmy Objects an AlterableValue called MaxHealth_
    When damage is delivered ( through a Collission or Overlap event ), subtract from Enemies Health_

    Event Editor, do 3 Events:

    If number of HealthBars is lower than number of Enemies
    --> Create HealthBar at 0,0

    If number of HealthBars is greater than number of Enemies
    + Pic a HealthBar at random
    --> Destroy HealthBar

    Allways
    --> Set HealthBar possition to Enemy possition
    --> Set HealthBar maxValue to Enemy MaxHealth_
    --> Set HealthBar value to Enemy Health_
    Thanks for the help, I will try this tomorrow and report back

  5. #5
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    Puff_N_Stuff's Avatar
    Join Date
    Apr 2009
    Location
    Stuart, FL. USA
    Posts
    51
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Wow, that is great to know. Thanks.

Similar Threads

  1. Street Fighter style health
    By Triclyde in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 23rd April 2010, 08:12 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
  •