How do I - Represent Life Bar

Get help using Construct 2

Post » Wed Apr 23, 2014 2:09 am

Hi guys,

How do I represent a life bar of an enemy with lets say 652 HP with a life bar of only 10 heart icons?

♥♥♥♥♥♥♥♥♥♥ = 652 HP

I was trying out some different ideas on paper but this really stumped me. :)
B
43
S
14
G
3
Posts: 288
Reputation: 8,866

Post » Wed Apr 23, 2014 3:09 am

65.2 hp per heart. You could use a tiled background and set the size to (hp/65.2*[heartwidth]), and then round up to the heartwidth.

Edit: To round up to 16: width = int(Sprite.HP/65.2)*16
health.capx

To change the amount to round to you can change the multiplier, e.g. for half hearts, use int(Sprite.HP/65.2*2)*8.
You do not have the required permissions to view the files attached to this post.
B
42
S
14
G
3
Posts: 165
Reputation: 5,115

Post » Wed Apr 23, 2014 5:29 am

WOW thanks Sumyjkl! That is a great idea to use the tiling bg for the bar. I have only ventured out into using it as terrain. :) Thanks again!
B
43
S
14
G
3
Posts: 288
Reputation: 8,866


Return to How do I....?

Who is online

Users browsing this forum: 25games, brunopalermo, maranpis, oosyrag and 24 guests