Pausing the Game

Andre87Andre87 Member Posts: 42
edited November -1 in Working with GS (Mac)
Is there any way to pause the game?

Comments

  • osucowboy18osucowboy18 Member Posts: 1,307
    Andre87 said:
    Is there any way to pause the game?

    Not within GameSalad, although that feature is supposed to be in an upcoming version of GS. However, there are several work arounds to achieve the same goal. Just make a boolean game attribute, game.paused for example, and then create a rule in every actor that needs to stop whatever its doing when game.paused is true and continue with what its doing when game.paused is false. For more details, check out http://gamesalad.com/wiki/how_tos:gsc_game_pause_tutorial Hope this helps :)

    - Alex
  • scitunesscitunes Member, Sous Chef Posts: 4,047
    just be patient

    :)
  • Andre87Andre87 Member Posts: 42
    Got it! Except for one thing. I have an missile object that accelerates towards the player, and while all objects stop doing what they were doing before the pause, the missile keeps accelerating in slow motion. However, the missile does not explode when it comes into contact with the player. It seems, that the all of missiles functions stop, except the acceleration. Which slows down instead of becoming 0.

    I even tried setting the missiles acceleration to 0 explicitly, when my pause attribute is equal to 0. Nothing, Nada.

    Anyone run into this problem before? Anyone know how to solve it?
  • jonmulcahyjonmulcahy Member, Sous Chef Posts: 10,408
    be patient, it'll be worth the wait. it should be out soon, and you don't have to deal with all those rules on every actor
  • Andre87Andre87 Member Posts: 42
    Got it! Except for one thing. I have an missile object that accelerates towards the player, and while all objects stop doing what they were doing before the pause, the missile keeps accelerating in slow motion. However, the missile does not explode when it comes into contact with the player. It seems, that the all of missiles functions stop, except the acceleration. Which slows down instead of becoming 0.

    I even tried setting the missiles acceleration to 0 explicitly, when my pause attribute is equal to 0. Nothing, Nada.

    Anyone run into this problem before? Anyone know how to solve it?
  • jonmulcahyjonmulcahy Member, Sous Chef Posts: 10,408
    i wouldn't worry too much about it, the new pause implementation SHOULD take care of it.
  • Andre87Andre87 Member Posts: 42
    I see, thanks much anyway :).
  • simo103simo103 Member, PRO Posts: 1,331
    Hi Andre87 .... I thought it might be helpful to know how to fix your problem anyway since you might need to address an issue like it in the future not related to pause.

    For example you might have a 'power-up' that freezes missiles in flight ... so the game isn't paused but an actor is.

    There was a forum thread on this a while ago and Synthesis had some ideas at the bottom but I don't see that anyone reported trying his idea. It does however explain the issue well.

    http://gamesalad.com/forums/topic.php?id=9190
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    make 2 real attributes attributes missilex and missile y. when you pause the game on the missile change attributes missile x and missile y to motion linear x and motion linear y . Then also change motion linear x and y on the actual missile to zero.. That will record there last movement before the pause and the linear motion rules will stop all movementt. then when you unpause change motion linear x and motion linear y to missile x and missile y. That wil have it continue when you left off.

    The problem is that you were using accelerat, and unless you add drag the acceleration still continues to occur tillit reaches its top speed even if your not pressing its button or whatnot.

    That should do it for you
  • simo103simo103 Member, PRO Posts: 1,331
    nice one John thanks .. I had setup a quick project to see what I could do (fail) but dropping in your suggestion and bingo!
Sign In or Register to comment.