Another Way to Pause the Game

Mr.pHMr.pH Member Posts: 26
edited November -1 in Working with GS (Mac)
I was wondering if there is another way to pause a game besides the one in the wiki.....i am creating a platformer and I want to be able to pause.....when I pause I want for example you to stay suspended in mid air or in the middle of your movement.....is there a way to freeze the state of the game?

Comments

  • JGary321JGary321 Member Posts: 1,246
    The one in the wiki is the only way I know of currently. You can still use it for you game. But realistically how many people are going to be able to hit pause and jump at the same time. The wiki will work for platform games.
  • Mr.pHMr.pH Member Posts: 26
    What I am trying to say is that you freeze all the action mid-game. Like if someone if falling...how would you code it so when you paused it the character would stop falling and then resumed it so they would continue to fall.
  • JGary321JGary321 Member Posts: 1,246
    You would make it so that the actor can only move if the game attribute called Paused = 0 (off). Since it can't move if it's paused it won't fall or anything. It would be one of the rules for everything you do.
  • Mr.pHMr.pH Member Posts: 26
    What if he is falling before you press pause. Is there a way to store the velocity and other thing all actors and reapply them when you resume the game.
  • JGary321JGary321 Member Posts: 1,246
    Jaowdee have u tried doing what I said yet? In my game my monsters stopped when paused, & then resumed moving when unpaused. Try it then tell us if it doesn't auto resume. For me my monster's speed was 60 & would only move at 60 if Paused = 0. If paused = 1 then they didn't move.
  • Mr.pHMr.pH Member Posts: 26
    Yeah but the thing is when I do that then gravity takes over and causes everything to fall to the ground. If I turn off gravity then turn it back on when I resume the game it just falls instead of continuing its path of motion.
  • JGary321JGary321 Member Posts: 1,246
    Hrmm, my particular game does not use gravity, so I cannot help on that one.

    Realistically, how easy is it to pause the game mid-air. Maybe make it so that the game will only pause once the actor has touched back down?
  • quantumsheepquantumsheep Member Posts: 8,188
    I think that what this shows is that while Jgary's idea is certainly a good solution, it's not one that can be used for *every* game.

    May I take this opportunity, therefore, to ask that there be a 'Pause Game' behaviour.

    That way we can create an actor with whatever graphic we'd like attached to it, put the Pause Game behaviour into it so that it toggles the game between pause and play states.

    OR, add a 'Resume Game' behaviour. That way, if the Pause Game actor is pressed it will pause the game, destroy the actor and place the 'Play Game' Actor in its place.

    Then when you press the 'Resume Game' actor, it resumes the game, destroys itself and spawns the 'Pause Game' actor in its place.

    We can already pause the entire game in GameSalad, so would this not be an easy win? The more iPhone games I play, the more I notice that a lot of them have a 'Pause' function!

    Cheers,

    QS

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

  • quantumsheepquantumsheep Member Posts: 8,188
    Actually, forget I said anything! ;)

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

  • Mr.pHMr.pH Member Posts: 26
    I agree with quantumsheep. It would be great if there was some sort of built in pause function in the game.
Sign In or Register to comment.