How do I fix width size for sprite?s

Get help using Construct 2

Post » Sun Jan 29, 2017 10:10 pm

hi to every one, i would like to do this

every time i click i remove -10 to sprite width

the sprite is a life bar, it is possible to fix/force a MAXIMUM SIZE?

my life bar grow every time my variable xp grow but i would like to have allways the same width, not growing with the xp difficulty.

what i need is a life bar who become harder to reduce by clicking, like in tapeventures https://www.youtube.com/watch?v=yqwBdTTdksw
B
37
S
15
G
7
Posts: 1,680
Reputation: 9,612

Post » Sun Jan 29, 2017 10:36 pm

Convert the health to a percentage of total, then multiply that with your desired life bar display width.

CurrentHealth/TotalHealth*DisplayWidth
Mistakes were made.
B
51
S
25
G
107
Posts: 1,581
Reputation: 60,458

Post » Sun Jan 29, 2017 10:41 pm

Thanks, do you have a capx with the formula? :D
B
37
S
15
G
7
Posts: 1,680
Reputation: 9,612

Post » Mon Jan 30, 2017 11:14 am

:D
B
37
S
15
G
7
Posts: 1,680
Reputation: 9,612

Post » Mon Jan 30, 2017 6:09 pm

https://www.dropbox.com/s/2kqyjcxe1dd67 ... .capx?dl=0

I would appreciate if you made an attempt before asking me to make it for you, or at least ask about what you didn't understand.
Mistakes were made.
B
51
S
25
G
107
Posts: 1,581
Reputation: 60,458


Return to How do I....?

Who is online

Users browsing this forum: Baidu [Spider], DeXVinogradov, evillair, lordsas, mongoose665 and 53 guests