life bar help

This forum is currently in read-only mode.
0 favourites
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • Okay searched the forums and I cannot find how to make life bars. I want to make a 4 heart life bar, every time the main character gets hit he loses a life...Please help

  • This is done very easiliy, actually. Using Animation frames.

    The goal is to have the Animation Frame equal to how much health you have.

    The events:

    ->Always

    +Healthbar.Frame = Player.Value('health')

    That's about it...

  • or

    Always

    heart.destroy

    For 0 to global('life')

    system, create object "heart" at global('lifebarx')+((heart.width+5)*loopindex)

    that doesn't need multiple frames

  • Using a single heart that's square in dimensions loaded to the tiled background object, and scaled to 4 times its original width.

    For example if the heart was 32x 32 scaled to 128x 32

    On damage received

    heart set width to heart.width- 32

  • Using a single heart that's square in dimensions loaded to the tiled background object, and scaled to 4 times its original width.

    For example if the heart was 32x 32 scaled to 128x 32

    On damage received

    heart set width to heart.width- 32

    Hi is it's a bit old post, but I have a problem.

    I've done what you say, to go climbing frame, but what it does is that it makes the cut only smaller, and only does it when you discount the first life to the player, with the other three did not do anything.

    Let's see if someone can give me alguan solution, or if there is another way to do it. <img src="smileys/smiley19.gif" border="0" align="middle" />

  • Using a single heart that's square in dimensions loaded to the tiled background object, and scaled to 4 times its original width.

    For example if the heart was 32x 32 scaled to 128x 32

    On damage received

    heart set width to heart.width- 32

    Or you set health variable for the player. Private variable health=4

    And on events:

    Always

    TiledBackround: Set width to Player.Value('health')*32

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hy guys,

    Someone has an example .capx file? I want to create a life bar with 3 hearts. (When player on collision with enemy destroy 1 heart and the same with stars counter, when player on collision a star, system generate a star on counter). Is possibile?

    https://dl.dropboxusercontent.com/u/122498815/Scirra%20-%20Construct2/HealtBar.capx

    Currently i have this but is not good for me.

    <img src="http://i42.tinypic.com/2ymy2qf.png" border="0">

  • Hy guys,

    Someone has an example .capx file? I want to create a life bar with 3 hearts. (When player on collision with enemy destroy 1 heart and the same with stars counter, when player on collision a star, system generate a star on counter). Is possibile?

    https://dl.dropboxusercontent.com/u/122498815/Scirra%20-%20Construct2/HealtBar.capx

    Currently i have this but is not good for me.

    <img src="http://i42.tinypic.com/2ymy2qf.png" border="0">

    <img src="smileys/smiley19.gif" border="0" align="middle">

  • <img src="smileys/smiley19.gif" border="0" align="middle">

    Hey, you've only just asked your question a day before you bumped the request. We can only reply as quickly as we have (free) time to make examples.

    However, I will try and make you one soon and upload it for you. In the mean time you could dig around the source code to my game IHadHope as I did something like what you want too I believe: http://ihadhope.blogspot.ca/p/download.html

  • >

    > <img src="smileys/smiley19.gif" border="0" align="middle">

    Hey, you've only just asked your question a day before you bumped the request. We can only reply as quickly as we have (free) time to make examples.

    However, I will try and make you one soon and upload it for you. In the mean time you could dig around the source code to my game IHadHope as I did something like what you want too I believe: http://ihadhope.blogspot.ca/p/download.html

    Thanks, I did not hurry :)

    I will look your link!

  • Simo ah okay, well I've made an example now, hope this is what you need!: https://dl.dropboxusercontent.com/u/4714446/LivesScore.cap

    <img src="smileys/smiley1.gif" border="0" align="middle">

  • Simo ah okay, well I've made an example now, hope this is what you need!: https://dl.dropboxusercontent.com/u/4714446/LivesScore.cap

    <img src="smileys/smiley1.gif" border="0" align="middle">

    Thank you very much for the time you have spent. :)

    But i can not use the file with costruct, maybe do not recognize the format? Isn't a .capx?

  • Ah you're using Construct 2 then <img src="smileys/smiley6.gif" border="0" align="middle"> The older Construct Classic (which this subforum is/what cap files are made in) is completely free and open source, and you can find some links to it here: http://ihadhope.blogspot.ca/2013/05/construct-classic-r2-examples-kit.html

    The events would be pretty much the same in Construct 2 too!

    However, I'll also look into making a capx version for you.

  • Ah you're using Construct 2 then <img src="smileys/smiley6.gif" border="0" align="middle"> The older Construct Classic (which this subforum is/what cap files are made in) is completely free and open source, and you can find some links to it here: http://ihadhope.blogspot.ca/2013/05/construct-classic-r2-examples-kit.html

    The events would be pretty much the same in Construct 2 too!

    However, I'll also look into making a capx version for you.

    Thank you very much mate.

  • Simo, finally had some time to throw this into Construct 2 format, here you go: https://dl.dropboxusercontent.com/u/4714446/LivesScore.capx

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