GameSalad

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Little countdown after unpause?

justinodunnjustinodunn Posts: 226Member, PRO

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 Posts: 8,188Member
    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: http://www.quantum-sheep.com

  • justinodunnjustinodunn Posts: 226Member, PRO

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

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

    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 Posts: 226Member, PRO

    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 Posts: 8,188Member
    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: http://www.quantum-sheep.com

  • justinodunnjustinodunn Posts: 226Member, PRO

    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 Posts: 8,188Member

    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: http://www.quantum-sheep.com

  • justinodunnjustinodunn Posts: 226Member, PRO
    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 Posts: 8,188Member

    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: http://www.quantum-sheep.com

  • justinodunnjustinodunn Posts: 226Member, PRO

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

  • quantumsheepquantumsheep Posts: 8,188Member

    Yes - updated file attached.

    QS

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: http://www.quantum-sheep.com

  • justinodunnjustinodunn Posts: 226Member, PRO
    edited March 2014

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

  • quantumsheepquantumsheep Posts: 8,188Member

    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: http://www.quantum-sheep.com

  • justinodunnjustinodunn Posts: 226Member, PRO

    Nooo this game will be different :smile:

  • quantumsheepquantumsheep Posts: 8,188Member

    \o/

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: http://www.quantum-sheep.com

  • JodyMitomaJodyMitoma Posts: 307Member

    @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.