How do I stop sprite width

Get help using Construct 2

Post » Fri Oct 23, 2015 6:38 pm

Following some exp/health bar guides, I have done so in which I determine the top bar's width by "(current/max)*bottom_bar.width"

gyazo.com/1c1e4be993f5d3b47e4b1202e9b57fa3

gyazo.com/317c13feab3e9ac87f821197e60a1d22

This GIF shows what my problem is, it doesn't capture it properly, but right at the end, it shows the green bar extending beyond. From the screenshot, you can see I tried to to set the counter1 to 100 when its value => than 100. The problem is that it goes beyond 100, thus the bar's width extends accordingly, then the value is set back to 100, and the bar shrinks accordingly. How do I fix this?

Note: This happens very noticeably, and all the time, the gif just didn't capture the bar extend properly.
B
6
Posts: 40
Reputation: 336

Post » Fri Oct 23, 2015 7:18 pm

Have you tried not updating the bars width until after you have adjusted the value?
Check out my completed games on the Arcade! Capt. Doe Save the Universe! & Clicker Wizard!
B
70
S
19
G
8
Posts: 639
Reputation: 9,674

Post » Fri Oct 23, 2015 8:01 pm

chrisinfinger wrote:Have you tried not updating the bars width until after you have adjusted the value?


Is it because I have this on System>Every tick? If this is the problem, what do you suggest I change it to?
B
6
Posts: 40
Reputation: 336

Post » Fri Oct 23, 2015 8:11 pm

Construct reads events from top to bottom..

your event adding 10 is beneath the event setting it back to 100 if above 100..

change the order of these events and all should be ok..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775


Return to How do I....?

Who is online

Users browsing this forum: jezjones24 and 23 guests