Could anybody help me with this simple Healthbar+Medikit?

0 favourites
  • 3 posts
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • Hello!

    I read a lot in different tutorials about health-bars, but i didn't find one like i want to create.

    I want a simple healt-bar out of 3 bars and a medikit-item which adds one "health-point" (and health-bar)

    to the player and the screen. When the player collides with an enemy, one hPoint and one hBar will be subtracted,

    when he collides with a medikit, one hPoint and hBar should be added.

    This works already:

    • when player collides with enemy, one point and one bar will be subtracted
    • if player has 2 hPoint+hBars and collides with an medikit he gets on more hPoint+hBar

    BUT:

    if the player has 1 hPoint+hBar and collides with a medikit he get two more healtbars! ( it jumps from 1 to 3!)

    could somebody look at the picture of the event-editor and give me some tips to fix my problem?

    thank you much in advance!

  • Your issue is that when event 6 is true it's actions make event 7 true in that same tick..

    Events are read from top to bottom.

    You could convert the gesundheidspunkte to a subevent and use an else event for the second one, but in this case switching event 7 with event 6 would also work..

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • yessssssssss thank you!

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