0 Favourites

Health Bar, HELP!

This forum is currently in read-only mode.
  • Ok, I'm a newbie in this program. My teacher said to me to make a game, but i dont know what to do from now on.

    I mean, I made a health bar for my char, but, i put all that programming stuff in the right place as I saw in the tutorial.

    The normal would be, the health bar full above my char and when I touch something who'd hurt him, he loses it, it's what I wanted do to, But my health bar starts tiny, and instead of lose, it gains health :(

    I don't know what to do, i'm going crazy to hell, anyone can help me? =(

    ps: sorry for my english xP

    Here is it Game

  • You are subtracting a negative one from health which is, infact adding one to health. Thats it! Just a double negative resulting in a positive.

    I'm looking into health bars right now, I'm doing more of the zelda approach since thats how the original game was.

    Learning this new (new to me!) program is pretty fun.

    Have fun! Good Luck!!

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • Health bars are fun. I like to set a maximum health number and then use that for a percentage calculation. Something like:

    Always set Healthbar Width to CurrentHealth / MaxHealth * MaxHealthBarWidth

    Alternatively, what you have should work just fine. The problem with it "growing" is that it's not actually growing, it really is shrinking. You have your Private Variable 'Health' set to an initial value of 0, so when Lugia gets hit by the wave he ends up with negative health. In Construct, an image with a negative size value basically just sort of mirrors/flips itself.

    Here's a "fixed" cap. Check it out!

    http://dl.dropbox.com/u/20459682/lugia.cap

    All I did was get rid of the initial "Always set Healthbar width to 65" due to redundancy since almost immediately after you set it to Lugia's 'Health'. Then I just set the value of Lugia's 'Health' to start at 70. Voila! Healthbar that shrinks as Lugia gets hit.

  • Thank You folks for your support. I'll try the fixed one.

    By the way, i'm a newbie in programming, it causes me a lot of headache, believe me =D

  • Forgot to say it worked well, thank you guys ^^

  • Good to hear!! Seeing a working result is always rewarding! Just made a clock/countdown til death timer for my demo. Crappy Arial font is the next thing to go :)

    Have fun!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)