Trouble with some behaviours

BasGoodboyBasGoodboy Member, PRO Posts: 310
Hello,

First of all, i'm new to GameSalad, and using a windows computer and therefor the Windows creator.

What I want, is an app that keeps memorise of the last actions, so if people close the app and start it again, they have the same screen or level that they were when they closed the app. Is this possible?

The trouble by creating my game is now, I want, when a certain button is pushed, that the character goes to sleep for 1 hour. And in that hour, no other buttons can be touched and the main character/actor is really asleep and it's not possible to do any other actions for an hour long.

How could I make this?

Best regards,

Bas Goodboy.

Goodboi Gamestudios | Monster Jumper now on the App Store

Comments

  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273
    To save your game you'll want to use the Save and Load behaviors inside Creator.

    For your hour of sleep, create a Boolean attribute called Sleep. Set it to false.
    When the player goes to sleep, set that attribute to true.

    Go inside each of your buttons, and in the rules that say when touch is pressed, add another condition : When attribute game.Sleep is false

    This will only allow the buttons to be pressed when that attribute is false.

    When the player wakes up, set game.Sleep to false.

    Hopefully that gets you on the right track.
  • BasGoodboyBasGoodboy Member, PRO Posts: 310
    Super answer, gonna try and make it. Since im new to gamesalad;

    Should I creat the Boolean on the scene or or the button actor called 'sleep'.

    ?

    Goodboi Gamestudios | Monster Jumper now on the App Store

  • BasGoodboyBasGoodboy Member, PRO Posts: 310
    And about the following thing:
    'For your hour of sleep, create a Boolean attribute called Sleep. Set it to false.
    When the player goes to sleep, set that attribute to true.'

    How can i do this thing:
    When the player goes to sleep, set that attribute to true.'

    Whats the 'code' for this?

    Goodboi Gamestudios | Monster Jumper now on the App Store

  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273
    Since you're new, I'd recommend heading over to gshelper.com and taking a look at our free video tutorials. They'll help you understand the basics. Once you know those, you'll be able to create your sleep attribute and buttons. You'll have a much better understanding about how to do it.
  • BasGoodboyBasGoodboy Member, PRO Posts: 310
    edited August 2013
    Edit:

    After a bit of trying i think i almost got it..

    Only I need the rule for changing the Sleep attribute Boolean from false to true.

    So when touch is pressed > change attribute game.Sleep to: .....

    What should come on the ...??
    In other words.. how can I choose to change the true/false indicator on the Boolean?

    Goodboi Gamestudios | Monster Jumper now on the App Store

  • BasGoodboyBasGoodboy Member, PRO Posts: 310
    Ahh I got it .. it's: set Game.Sleep to 1 (in stead of 0)

    Goodboi Gamestudios | Monster Jumper now on the App Store

Sign In or Register to comment.