How to make a change scene button appear

cjb695cjb695 Member Posts: 5
edited November -1 in Working with GS (Mac)
I am creating a brick breaker type of game and i want a way to change scene, i have created it but it appears at the beginning and i want it to appear after the gamer beats the level....any help with be appreciated.

Comments

  • quantumsheepquantumsheep Member Posts: 8,188
    You'll be glad to know there are a couple of ways!

    1. When the game reaches 'end of level', spawn a change scene button at X,Y relative to scene
    2. When the game reaches 'end of level', move the change scene button onto the screen from 'off' the screen.

    The latter is more efficient, though not always wonderful.

    Make a new actor and call him (er, or 'her') "end of level control".

    Create a rule that checks for the end of the level. In your case I'd imagine 'if blocks = 0"

    Then drag into the rule either a 'Spawn' behaviour or a 'Move to' behaviour.

    Behaviour's are found in the behaviour tab underneath the inspector window (where you can see all your game's actors).

    Hope that helps,

    QS

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

  • cjb695cjb695 Member Posts: 5
    that helped alot but i dont get the part about the end of the level and the rule i got the behavior part though

    Create a rule that checks for the end of the level. In your case I'd imagine 'if blocks = 0"
  • quantumsheepquantumsheep Member Posts: 8,188
    Well, how does the game end? What makes it go from 'playable' to 'game over' or 'game success'.

    When that happens, your level effectively 'ends' and you want to move on to another screen.

    Hope that helps,

    QS

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

  • cjb695cjb695 Member Posts: 5
    ok thanks...also is there a way to make and lose levels
  • quantumsheepquantumsheep Member Posts: 8,188
    I'm not sure what you're asking by 'make' levels. When you start up GS, there should be all your levels on the lower half of the pane on the 'home' screen - they're called 'scenes' and you can add a new one by pressing the + button in the bottom left.

    These can be levels, option pages, title pages etc etc

    If you think about your breakout game, there must be, as in most games, elements of risk and reward and the chance of failure.

    What is the goal of your game? What would stop you doing that? Do you have lives? What happens to make you lose a life? If you lose all your lives, then that would be game over, right?

    So you have to work out what you want the 'game over' conditions to be. Then when these happen, usually done through 'rules' in GS, go to the game over screen (which is one you'd make from the Home panel - see above).

    I hope that helps. Sorry if I've misunderstood you in any way, it's not intentional - just trying to help!

    Cheers,

    QS :)

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

  • cjb695cjb695 Member Posts: 5
    sorry i meant lives...sorry you had to type all that
  • quantumsheepquantumsheep Member Posts: 8,188
    It's ok, I type fast and hopefully someone will find it useful ;)

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

  • cjb695cjb695 Member Posts: 5
    haha ya...so how do you make lives and how do you make them be lost
  • quantumsheepquantumsheep Member Posts: 8,188
    You can find the wiki here: http://gamesalad.com/wiki/

    It's also linked to at the top of this page!

    Within these hallowed pages you'll find:

    How to change a scene: http://gamesalad.com/wiki/how_to_gsc_change_scene_button

    How to display lives: http://gamesalad.com/wiki/how_to_gsc_display_lives

    To actually 'make' lives, just make a new variable. Click on the 'Attributes' tab in the main panel on the left where your actors are.
    Add a new integer variable called 'Lives' - or whatever you want to call it.
    Give this the value '3' or however many you want to give.

    When something happens that makes your player lose a life put in a 'change variable' behaviour into the relevant actor.

    For example, in your breakout game, you may want to make the player lose a life every time the ball gets past him.

    So on the ball actor, have a rule that says:

    if self.position y is less than or equal to 0
    Then change behaviour lives to lives-1

    Then, make another actor, let's call him 'control' and put him out of sight off the screen.
    On him, place a rule that says:
    If lives equals or is less than 0
    Then change scene to Game Over.

    Hope that helps,

    QS :)

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

Sign In or Register to comment.