Custom Health Bar?

For questions about using Classic.

Post » Sun Dec 25, 2011 12:42 pm

Hello. I was wondering if there was some way to create a health bar or some sort of curved image to use as a health bar. Something like this:

I'm trying to create a health bar similar to that used in Kingdom hearts 2. I'll be using custom graphics of course but I was wondering if such a thing was possible. I'd also like to be able to extend the end of the bar so that it behave likes a normal health bar, only that it curves around an image or whatever in a circle fashion like in the above image.
B
2
S
1
G
1
Posts: 12
Reputation: 624

Post » Sun Dec 25, 2011 1:21 pm

Is that Stitch? Where is Lilo?

But yeah, that kind of radial health bar is tricky. There is no simple way to achieve it. You could fake it with sprite animations, but well, it would go in "steps" rather than gradually.

Oh wait, now that I look again, this is for Construct Classic. Perfectly possible with sprite distortion/displacement. But that's beyond the scope of my modest understanding.
B
62
S
21
G
12
Posts: 1,910
Reputation: 13,155

Post » Sun Dec 25, 2011 1:40 pm

There are a few ways you can approach this....

1. If you wanted to make just a bar you could use the progess bar object and have it where each time your character sustains damage the bar goes down a certain amount.

2. You could also make a bar by using animation frames that disappear revealing a bar with less length underneath it each time the character is damaged. Or, instead of doing a disappearing approach, you could take a sprite object and put several frames into the animator, then have each frame correspond with the damage the character receives.

3. Another thing you could do is make a bar out of a single sprite, and each time the character is damaged you could decrease the length of the bar.

4. As for making a curved health indicator, you could do any of what's mentioned in #2.
B
12
S
4
G
3
Posts: 426
Reputation: 2,458

Post » Sun Dec 25, 2011 2:04 pm

I should also mention that you'll need to use either a private or global variable (your choice) to keep track of the characters damage. I'll try to make an example for you when I get time, unless someone else beats me to it.MrMiller2011-12-25 14:05:11
B
12
S
4
G
3
Posts: 426
Reputation: 2,458

Post » Sun Dec 25, 2011 2:17 pm

Here ya go: Radial_Health_Example.cap

I'm sure it can be improved if you spend some time with it.
Image
B
225
S
27
G
13
Posts: 1,774
Reputation: 18,024

Post » Sun Dec 25, 2011 2:32 pm

Image Image
B
161
S
48
G
89
Posts: 7,347
Reputation: 66,249

Post » Mon Dec 26, 2011 12:07 am

I've got to say that this forum and community is amazing. Thank you so much for the replies and the example caps.
B
2
S
1
G
1
Posts: 12
Reputation: 624

Post » Mon Dec 26, 2011 12:15 am

[QUOTE=Tokinsom] Here ya go: Radial_Health_Example.cap

I'm sure it can be improved if you spend some time with it. [/QUOTE]

Alright, this one is near perfect. I have one question though. Is there any way to continue along a specific angle after the angle reaches 270? I sort of want to continue to extend the bar along that angle. If I set the angle to 0, 180 and such, the entire sprite turns to that angle but I want to retain the previous curvature of the bar.
B
2
S
1
G
1
Posts: 12
Reputation: 624

Post » Wed Dec 28, 2011 8:45 pm

I've figured it out. Sorry for triple posting. Here is the final result so that others who might want it can use it.

http://dl.dropbox.com/u/54897686/Radial_Health_Example_Final.cap
B
2
S
1
G
1
Posts: 12
Reputation: 624

Post » Thu Dec 29, 2011 2:04 am

And now with colors!

http://dl.dropbox.com/u/26932498/hp.cap

When it goes below a specific number, it changes the color :Pzyblade2011-12-29 02:14:18
B
24
S
9
G
2
Posts: 294
Reputation: 3,160

Next

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 8 guests