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
39
S
16
G
7
Posts: 1,727
Reputation: 9,865

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
53
S
27
G
114
Posts: 1,699
Reputation: 64,446

Post » Sun Jan 29, 2017 10:41 pm

Thanks, do you have a capx with the formula? :D
B
39
S
16
G
7
Posts: 1,727
Reputation: 9,865

Post » Mon Jan 30, 2017 11:14 am

:D
B
39
S
16
G
7
Posts: 1,727
Reputation: 9,865

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
53
S
27
G
114
Posts: 1,699
Reputation: 64,446


Return to How do I....?

Who is online

Users browsing this forum: jezjones24, NN81, R0J0hound and 8 guests