Pause button

tekkendptekkendp Member Posts: 49
edited November -1 in Working with GS (Mac)
Hi guys,

Managed to create a pause button for my game. And it works - sort of. When I click to pause or unpause, it seems like it doesn't always read the mouse click on the pause actor. Sometimes it works, sometimes not.

I created an actor called pause. I also created a global attribute called game paused (assigned boolean false as default). I then added a change attribute (nested in a rule) to all movable actors as false. So if false actors move, if true they do nothing.

The pause actor looks like this:-

<img src=http://www.freeimagehosting.net/uploads/th.30e5ff2c7e.png alt="Free Image Hosting by FreeImageHosting.net">

Any ideas why i'm getting intermittant response?

Comments

  • tekkendptekkendp Member Posts: 49
    Hi tshirtbooth,

    thanks for the tip - tried that. Still getting the same results. Currently checking the logic in the game to see what's screwing up the pause action. Any more tips would be warmly accepted.
  • quantumsheepquantumsheep Member Posts: 8,188
    OR

    You could just have the rule:

    IF Pause button is pressed...

    Got to Scene 'PAUSE' - while making sure that you tick the 'preserve current scene' button.

    Then on the pause screen, have a 'Go back' actor that says:

    If 'Go back' is pressed

    Then go back to scene 1.

    If you have multiple scenes, make a real number variable for each scene. e.g. when you start game scene 1, change attribute 'Level' to 1.

    If you do this for each level, then you can state on your pause screen:

    If level = 1 then go to level 1.
    If leve = 2 then go to level 2.

    etc.

    Hope that's clear and helps!

    QS :)

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

  • tekkendptekkendp Member Posts: 49
    QS - you are ace!!! That has worked perfectly. And it looks even better now - thanks a million.

    So now in the pause scene, I can put all the "if's" in a group? Is that recommended?
  • ckurt25ckurt25 Member Posts: 122
    QS, I tried setting up my pause scenario that way but when I return to the main scene the actors I have that are supposed to be spawning stop spawning. Any ideas on how to get them started again? I have preserve current scene checked for that rule. If I try it without checking that off, the actors will continue to spawn but when I return to the scene their positions are reset and therefor creating a cheat (if the main actor is about to get hit, pause the game, return and the actor that was about to hit him is gone).

    I searched the forums and saw there may have been an issue with preserve scene function with 0.8.1 but that it was fixed in 0.8.2. I just created this brand new in 0.8.2 and it still seems to be broken. Is this a bug?
  • iDeveloperziDeveloperz Member Posts: 1,169
    @tshirt what is the 2% for?
  • quantumsheepquantumsheep Member Posts: 8,188
    @Ckurt25 - it's a bug with .082 - hoping it'll get fixed in .83 ;)

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

  • ckurt25ckurt25 Member Posts: 122
    Thanks, QS.
  • quantumsheepquantumsheep Member Posts: 8,188
    /curtseys

    Not a problem.

    er...

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

  • tekkendptekkendp Member Posts: 49
    Hi QS,

    Do you know of any other way to pause a game (while we wait for the Gamesalald guys to fix this bug)? I went back to my old method, and that is still a no go.

    I have been emailing Jonathan (who has been very helpful), and recommended save/load attributes behaviours, but I'm not sure I want to do it that way, as it will increase the amount of attributes required - which I understand from reading up on here, can seriously slow things down. I have already had to add extra stuff to get my sound working with destroy bug.

    So, any tips? Cheers.
Sign In or Register to comment.