How do I relate the % of missing health to my life's bar

Get help using Construct 2

Post » Wed Mar 19, 2014 6:15 pm

This example might be useful for you. It's a circular life bar example that I made and it shows how to increase/decrease it smoothly and it shows the % too
B
84
S
22
G
15
Posts: 1,039
Reputation: 15,249

Post » Thu Mar 20, 2014 12:35 am

feyninja wrote:
kossglobal wrote:Me too :D
At least dt I understand a bit.

It's important to use dt in every custom movements of objects to prevent lag?
So If I want to move something 30 degrees, It would be something like this: 180*dt?


Yup, if not the lag will break the game.


Is necessary to use dt when I set vector, since it'snot the object's speed, but a parameter to his platform movement?

7Soul wrote: might be useful for you. It's a circular life bar example that I made and it shows how to increase/decrease it smoothly and it shows the % too


My life's bar is working already but I'll check it out for sure. thanks man.
B
56
S
21
G
3
Posts: 602
Reputation: 6,612

Post » Thu Mar 20, 2014 3:05 am

kossglobal wrote:Is necessary to use dt when I set vector, since it'snot the object's speed, but a parameter to his platform movement?

If the actions come from behaviors you don't need to use dt.
Don't forget behaviors already use dt (except with Physics where you must turn it on yourself). If you use behaviors to control all motion in your game, you don't have to worry about dt at all!
B
24
S
4
G
2
Posts: 41
Reputation: 1,543

Post » Thu Mar 20, 2014 4:15 am

@feyninja

Ya, I read it in the manual. But the simulate control, where I can set the vector, is a custom behavior, but setting the vector Y -700, for an example, isn't necessary to use dt because I'm not setting movement. Right?
B
56
S
21
G
3
Posts: 602
Reputation: 6,612

Post » Thu Mar 20, 2014 6:13 am

Set vector Y action from platform behavior right? I'm not so sure but i think you don't have to worry about dt, because they're a part of the behavior.
B
24
S
4
G
2
Posts: 41
Reputation: 1,543

Post » Thu Mar 20, 2014 6:49 am

feyninja wrote:Set vector Y action from platform behavior right? I'm not so sure but i think you don't have to worry about dt, because they're a part of the behavior.


That's exactly what I meant. I guess too.
B
56
S
21
G
3
Posts: 602
Reputation: 6,612

Post » Thu Mar 20, 2014 11:14 am

@OP: I used this tutorial to create my HP bars. https://www.scirra.com/tutorials/449/cr ... -healthbar

@7Soul: That's really cool! I'm going to learn how you did that.
B
5
S
1
Posts: 31
Reputation: 437

Previous

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 10 guests