bar movement stop

Get help using Construct 2

Post » Wed Mar 20, 2013 1:42 pm

hey guys! In need of some help yet again (still too noob).

I want the bar (labelled Chakra) to maintain its length while the animation(sprite 2) is playing. then when its done to return to its original length. I've been playing around with it but still no use


https://www.dropbox.com/s/ckw1i23x7g72136/random.capx

Hopefully its not too hard! I've added my cap file as it probably is a bit hard to explain through words.

Thanks again guys!
B
7
S
2
G
3
Posts: 31
Reputation: 2,446

Post » Wed Mar 20, 2013 1:52 pm

I can't understand very well what you mean, but I think you're mistaking "animation" for some other thing.

This is the Sprite2 object:


And it's animation name is "boom":


So, if you want something to happen when it's animation has stopped playing, you have to set an event like "Sprite2-> Has animation "boom" finished playing", like this:
B
106
S
35
G
36
Posts: 794
Reputation: 24,707

Post » Wed Mar 20, 2013 9:43 pm

@andreyin hey there thanks for taking the time to help me out!

Hm let me try rephrase it. Basically I've set it so the bar (the yellow one) needs to be greater than 1(width) for the animation sprite 2 to play.

This is done by holding the down button (charges the bar) and then press the red button.

What im trying to do is make it so the bar stays at the length i held it to when the animation plays. then after the animation finishes the bar goes back to the initial length.


:S really sorry if this is still confusing. Thanks again for the help though!
B
7
S
2
G
3
Posts: 31
Reputation: 2,446

Post » Wed Mar 20, 2013 10:56 pm

i would use a system wait for the duration of the animation then set the chakra bar to its original length.
B
17
S
2
G
2
Posts: 82
Reputation: 1,712

Post » Thu Mar 21, 2013 2:59 am

Please don't take this personally, but it's very difficult to make sense of your description, and ever more so, the capx. It's a lot easier to provide assistance if the capx is concise, and your desired result is fully explained.

I'm not sure exactly what you're goal is, but I think I may have deduced it. I'm guessing you want the player to hold the down arrow button to charge up the yellow bar, and if the the player presses the red button while the yellow bar is charged, Sprite 2 appear. You also want the bar to maintain its width for the duration of the animation, and then return to it's original width.

Andreylin mentioned that you can trigger something to happen at the end of Sprite 2's animation, but that won't work in this case, because you don't really end Sprite 2's animation, you just set it to invisible after the animation has completed. Therefore, the quickest fix I can think of was to only have the yellow bar change width when the Sprite 2 is invisible.

I hope this is what you were looking for.
B
44
S
13
G
7
Posts: 338
Reputation: 10,379


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 21 guests