How do I make a following health bar

Get help using Construct 2

Post » Fri Mar 13, 2015 2:01 am

I know how to make a basic life bar and have read several life bar tutorials.
Does anyone know a good way to go about making a life bar that will follow a player through several different levels.
https://www.dropbox.com/s/axht9wy3g6f73 ... .capx?dl=0
B
6
S
1
Posts: 47
Reputation: 759

Post » Fri Mar 13, 2015 2:16 am

Use a global variable for health. then use pin on the health bar and pin it Position only to the player.

that way it will stay with them, and it should carry over to the next level. If it doesn't carry to the next level, you could use webstorage to save health at level end and load it at level begin.
B
9
S
2
Posts: 80
Reputation: 864

Post » Fri Mar 13, 2015 2:59 am

It seems Jermfire and I understood your question differently. He understood it as how to make a health bar that stays pinned to the player. I understand your question to be, how to make a health bar that handles multiple player levels so no matter how high the players health is, it still shows the correct length. I have attached an example if that is really what you are looking for. Take a look at it. Basically you set the length of the health bar to 100 * (CurrentHealth / MaxHealth).

I hope you get what you need and good luck with your project.
You do not have the required permissions to view the files attached to this post.
B
40
S
12
G
11
Posts: 331
Reputation: 7,752

Post » Fri Mar 13, 2015 5:35 pm

Thanks both but FragFather got it right
B
6
S
1
Posts: 47
Reputation: 759


Return to How do I....?

Who is online

Users browsing this forum: blackhornet and 23 guests