I would like some help with animating my pause menu

0 favourites
  • 4 posts
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • 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?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • BUMP

  • 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 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!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)