using sprites as a live meter

This forum is currently in read-only mode.
From the Asset Store
Full game Construct 2 and Construct 3 to post on Google Play
  • Hello everyone

    glad to ask again

    my question this time is for anyone one that ever used game maker

    can i use sprites as live meter or lives

    if so can anyone fix the .cap for me

    thank you in advance

    ps:.CAP file

  • 53 views without a single reply

  • It's just too basic in my opinion.

    In short - yes, you can. Don't have Classic on pc atm

  • well how about describing it even with construct 2

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • hey, i added the life meter.

    dl.dropbox.com/u/45834687/lifemeter.cap

    i explained what i did and how it works in the event sheet.

    i used a tiled background instead of a sprite,

    it repeats vertically and horizontally, so you need to keep the height normal, and take the normal width, and multiply it by the number of lives.

    at first i added a check to see if you had more than 0 lives, but at the end i dont think you need it, but i forgot to remove it.

    what you need to do is make the plane respawn after dying.

    i think it should work

    if you have any questions let me know, <img src="smileys/smiley2.gif" border="0" align="middle" />

  • I wish you look at it again whn the plane is destroyed and life count is 2

    the tiledbackground disappear

  • For me, I have a single sprite with multiple frames of animation (set to 0 speed so it doesn't animate.) Each frame number corresponds with a global variable for health/hit points. Ie if global variable "life" = 2, set sprite "hp" animation frame to 2, and so on. Very simple to set up, every thing is in a single object, no math involved. If the max healt is 3, it also helps to have an event where if glob.var "life" > 3 set "life" to 3 to make sure you avoid errors with health-restoring items.

    Of course, this would be less effective with large bars ala Zelda, but there are more compact and creative ways to show health anyways <img src="smileys/smiley17.gif" border="0" align="middle" />

  • Thanks

  • that is just because once the energy = 0, the life is lost

    BUT you need to set energy = 100 for the new life!

    or the counter will keep loosing lives if energy = 0,

    so it will go: lives 3 -1, 2 -1, 1 -1, 0, and you will only see 3 -> 0

    where it says "if the life counter is ON, lose 1 life, turn life counter OFF"

    add: *set global variable 'energy' to 100*

    but then what happens is, you lose a life,

    the counter shows 2, and energy 100, but no plane!

    because you destroyed the plane a forgot to create it again!

    you can either spawn a new plane at XY, or just move it XY and not destroy it.

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