User Tag List

Results 1 to 7 of 7

Thread: Can someone help me pause?

  1. #1
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Feb 2017
    Posts
    18
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Can someone help me pause?

    I'm trying to make a pause menu. I have a very basic set up so I can add stuff in later. I just want to get it to work before I make it complicated. By all accounts it should work, but for some reason it doesn't.
    For reference, my player has a alterable string named "State" that the code refers to. This should act as the "switch" so all my code turns off and on properly. The way the code is laid out I can make the game pause, but it does not resume. If I change the order of the "While_Paused" and "Pause_Controls" it does not work at all. Could someone please point me in the right direction?fake jump pause.jpg <=== (Screen shot of code)

  2. #2
    Clicker Fusion 2.5Android Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    amiman99's Avatar
    Join Date
    Dec 2015
    Posts
    243
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You could do pause many ways, one of them, you could put all your game code into one group, when a player presses the ESC, disable that group.

  3. #3
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Feb 2017
    Posts
    18
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    By all accounts this loop can do that. All I have to do is add the other groups to the loops. This does the exact same thing you're suggesting, only with loops. I'm trying to avoid making my many groups in to one big group, for better game control.

  4. #4
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Feb 2017
    Posts
    18
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is still not solved, and I can't figure out what went wrong with the code. It /should/ work as written... Help please?

  5. #5
    Clicker Fusion 2.5Fusion 2.5+ DLC
    casleziro's Avatar
    Join Date
    Mar 2013
    Location
    United States
    Posts
    619
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    try adding a cooldown to your button press. An alterable value will be fine.

    Upon pressing button
    +state = paused
    +cooldown = 0
    --> set cooldown to 5
    --> start loop unpause

    Upon pressing button
    +state < > paused
    +cooldown = 0
    --> set cooldown to 5
    --> start loop pause

    cooldown > 0
    --> subtract 1 from cooldown


    Also there's no need to activate/deactivate the "while paused" and "pause controls" groups in your "pause" and "unpause" loops. Just leave them open.

    Fusion reads the event sheet from top to bottom. Your two button press events are being read in the same update loop. The bottom-most event will be the most recent. The first event unpauses the game, but the second event gets read immediately after and pauses it again because the unpause loop set the conditions for it to fire. This happens, assuming you press pause one frame and unpause the next frame:

    frame 1
    -game currently isn't paused
    -escape is pressed
    -second button press fires: game gets paused

    frame 2
    -game is currently paused
    -escape is pressed
    -first button press fires: game gets unpaused
    -second button press fires because its conditions are now met by the unpause: game gets paused again

    If you switch the order of your button presses you'll see that the game never seems to pause at all.
    Adding a delay like I did (5 frames, but it can be however many you want) makes sure the presses get read separately.

    Here's an example: pause and unpause.mfa

  6. #6
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Feb 2017
    Posts
    18
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That worked perfectly, thank you so much!

  7. #7
    Clicker Fusion 2.5 Developer

    Join Date
    Feb 2014
    Posts
    951
    Mentioned
    15 Post(s)
    Tagged
    1 Thread(s)
    "cooldown" wat an awesome concept. that cud b used for many things. never quite thought of that before. cheers casleziro

Similar Threads

  1. Replies: 10
    Last Post: 15th October 2012, 04:33 PM
  2. Need a better way to pause...
    By Konidias in forum Multimedia Fusion 2 - Technical Support
    Replies: 22
    Last Post: 15th October 2010, 11:20 AM
  3. Best Way to Pause
    By drnebula in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 30th December 2009, 07:13 PM
  4. PAUSE?
    By scurvy in forum The Games Factory 2 - Technical Support
    Replies: 4
    Last Post: 30th May 2009, 07:51 PM
  5. Pause
    By Hordolur in forum Multimedia Fusion 2 - Technical Support
    Replies: 8
    Last Post: 24th July 2008, 08:11 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •