Little countdown after unpause?

justinodunnjustinodunn Member, PRO Posts: 226

I was wondering how to add a little count down of like 3 seconds with everything in the game paused as, and after 3 seconds the game fully resumes? the pause function can't do that because it requires you to change scenes. Cheers!

Comments

  • quantumsheepquantumsheep Member Posts: 8,188
    edited March 2014

    This is a question of variables/attributes.

    You'd need to make a 'pause' variable which has a value of 0 for not paused, and 1 for paused.

    In your actors, their movement will be wrapped in a rule e.g. if paused variable is 0 then move.

    Hopefully that's it.

    QS =D

    Edit: just to add, you would change the pause variable value to 1 however you do it (a button, getting a power up etc etc) then have a timer that says 'after 3 seconds change pause variable to 0)

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

  • justinodunnjustinodunn Member, PRO Posts: 226

    Ahh a lot of work then because i have spawners everywhere :p

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    Have you tried using a Pause Game behavior? It should work for that. You'd have a timer set to after 3 seconds unpause game.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • justinodunnjustinodunn Member, PRO Posts: 226

    I can't because when the game pauses it changes to the pause screen, and in order to unpause the user has the press the resume button in the pause screen

  • quantumsheepquantumsheep Member Posts: 8,188
    edited March 2014

    I think @tatiang means that on the pause screen, have an actor with a timer that simply says 'after 3 seconds, resume'

    No 'press resume button' needed ;)

    If you're worried about it using your current pause screen, make a new one with just that one actor in it.

    You could even splash out and display a countdown ;)

    QS =D

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

  • justinodunnjustinodunn Member, PRO Posts: 226

    Okay I seemed to have found a way around that but is it possible to make the pause behavior not affect specific actors? (the timer to countdown to unpause)

  • quantumsheepquantumsheep Member Posts: 8,188

    All you're doing when you pause the game is going to a new scene - you can add anything you want to a new scene.

    I'm not sure where the problem is? You just add a new actor that counts down from 3...

    QS

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

  • justinodunnjustinodunn Member, PRO Posts: 226
    edited March 2014

    My pause system works like this:
    When pause button is pressed, change scene to pause screen. when resume button is pressed, change attribute of alpha of everything in pause screen to 0 so the screen of the on going paused screen appears, and change attribute unpause to true. When unpause is true, set timer every 3 seconds animate "3, 2, 1 images" and when 3 seconds is up, destroy timer and unpause game.

    However, the countdown doesn't work when paused because at the pause stage, everything is paused.

  • quantumsheepquantumsheep Member Posts: 8,188

    I'm finding it hard to explain, so here's a demo :D

    Hope it helps,

    QS =D

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

  • justinodunnjustinodunn Member, PRO Posts: 226

    Thanks! I understand now :) but any ideas how to add custom font for the countdown numbers?

  • quantumsheepquantumsheep Member Posts: 8,188

    Yes - updated file attached.

    QS

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

  • justinodunnjustinodunn Member, PRO Posts: 226
    edited March 2014

    Nevermind, i fixed it. Thanks for your help! :smile:

  • quantumsheepquantumsheep Member Posts: 8,188

    Please make something other than a flappy bird game at some point!

    Otherwise I feel like I've unwittingly helped someone make a bomb!

    QS

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

  • justinodunnjustinodunn Member, PRO Posts: 226

    Nooo this game will be different :smile:

  • quantumsheepquantumsheep Member Posts: 8,188

    \o/

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

  • JodyMitomaJodyMitoma Member Posts: 307

    @quantumsheep said:
    Yes - updated file attached.

    QS

    Thank you, a million times. :) I added a rule, and placed everything you had in there so that users have to touch unpause button to unpause the game, and BAM... EXACTLY what I needed. You are a savior! Don't think I would of ever figured this one out.

Sign In or Register to comment.