Could anybody help me with this simple Healthbar+Medikit?

Get help using Construct 2

Post » Sat Jul 11, 2015 7:15 pm

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?
Image

thank you much in advance! :)
B
3
Posts: 5
Reputation: 185

Post » Sat Jul 11, 2015 7:38 pm

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..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Sun Jul 12, 2015 12:30 pm

yessssssssss :-) i tried both and both works :-) thank you!
B
3
Posts: 5
Reputation: 185


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 9 guests