I would like some help with animating my pause menu

Get help using Construct 2

Post » Fri Nov 07, 2014 1:09 pm

Hi, I would like to press the pause button, have everything stop, but the buttons animate in. Then when I press unpause, have the buttons animate out. I Have this working fine, but one of those buttons is a sound button and when I press it, it will not animate out with the other buttons. My buttons are animated images, so I have been using timescale along with animation speeds to get this far. I cannot simply just use a 2 frame image and swap between frames because I have an animated On button and Off button. Here is my set up.

All animations are set to 30 fps.
When Pause is true > set timescale to 0
When Pause is Not true > set timescale to 1

When Pause is true > set btnSoundOn timescale to 1
When Pause is Not true > set btnSoundOn timescale to 1

When btnSound is on frame 9 > set timescale to 0 (to stop it)
When btnSound is on frame 17 > set timescale to 0 and set frame to 0 (to loop it)

When btnSoundOn is touched > Destroy btnSounOn
When btnSoundOn is touched > Create btnSounOff and set it's timescale to 0 and set to frame 9 (frame 9 is where the animation reveals the full button)

When btnSoundOff is touched > Destroy btnSounOff
When btnSoundOff is touched > Create btnSounOn and set it's timescale to 0 and set to frame 9


This is where everything gets messed up. Everything animates fine without touching any extra buttons and when I do touch the SoundOn button, it swaps out to the SoundOff button. However, after that it will not animate off like everything else even though it has the same code as all the other buttons. It animated off if I hit pause again, which is wrong because it animated off while the other buttons animate back in.

TLDR: I want to create an on/off function that is animated at the pause screen. I cannot just swap between 2 frames because my button movement is part of the animation I created in each button. Is there a better way to do this? Maybe using the 2 frame swap idea, but animating the position in Construct2 instead of in the button's animation?
B
6
S
1
Posts: 71
Reputation: 548

Post » Sat Nov 08, 2014 11:35 pm

BUMP
B
6
S
1
Posts: 71
Reputation: 548

Post » Sun Nov 09, 2014 2:06 am

I could be wrong, but it looks like you didn't set the timescale for btnSounOff to 1, so that's why it isn't reacting at all.
B
42
S
21
G
31
Posts: 685
Reputation: 20,321

Post » Mon Nov 10, 2014 11:53 am

rekjl wrote:I could be wrong, but it looks like you didn't set the timescale for btnSounOff to 1, so that's why it isn't reacting at all.

I think I just forgot to write that part here :/. I feel like an idiot now, I just moved stuff around and I think the timescale 1 was in the wrong location. I moved it down a couple spaces in the block of code and it works now. Thanks for trying to help!
B
6
S
1
Posts: 71
Reputation: 548


Return to How do I....?

Who is online

Users browsing this forum: Alvaro2, Donald Cela, Hadyurik and 10 guests