Finished level menu and continue button

Chr0nosChr0nos Wondering Vagabond AustraliaMember Posts: 113

Hi guys,
I've been stuck on this for hours now...
A few people have asked this question, but I still havent seen a fix for it.

So in my platformer, when you finish a level, I'm using a pause command to bring up a pause menu with next level buttons and a main menu button. Here's where I run into trouble. I set the "Next level" button on the pause screen up so that when clicked, it should 'change scene' to 'next scene', but it just wont do it.
A few people were saying something about creating a game attribute called "current level" and making it say +1 or something, but nothing has worked so far.
PLEASE PLEASE PLEASE can someone show me a fix for this in n00b language. I'm totally stuck.

Thank you in advance!

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    Here's a demo.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • Chr0nosChr0nos Wondering Vagabond AustraliaMember Posts: 113

    Thank you a thousand times @tatiang!
    I don't know what I'd do without you answering all my questions.

  • Chr0nosChr0nos Wondering Vagabond AustraliaMember Posts: 113

    @tatiang this works really well, but only when the player starts from level 1. For example, if they start at level 6, finish the level, the "Finished level" scene comes up and they choose next level, it takes them to the second level, because the game doesn't know they started on the 6th level.
    Any suggestions?

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    Yes, when choosing a level to start on, change game.level to match the number of that level.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • Chr0nosChr0nos Wondering Vagabond AustraliaMember Posts: 113

    Sorry tatiang, I dont quite follow. Could you break it down in n00b terms for me please?

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    If you have a button that says "Level 6" then in that actor you need to have a rule that says When Touch is Pressed, Change Attribute game.level to 6.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • Chr0nosChr0nos Wondering Vagabond AustraliaMember Posts: 113

    At the moment I have a pause screen that comes up when the player completes the level and a button that says "Next level". If I use that method, wont I have to create a pause screen for every level?

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited February 2015

    Your question was this:

    this works really well, but only when the player starts from level 1. For example, if they start at level 6, finish the level, the "Finished level" scene comes up and they choose next level, it takes them to the second level, because the game doesn't know they started on the 6th level.

    How does a player "start at level 6" in your game? And why is game.level not already set to 6 at that point? In other words, every time the player advances to the next level, you should be adding one to game.level. By the time they get to level 6, game.level should equal six. I guess I don't understand what you mean by "if they start at level 6."

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • Chr0nosChr0nos Wondering Vagabond AustraliaMember Posts: 113

    Sorry for not being clear.

    Basically, I want to use the system where the player must play through each level to unlock the next, but once a level has been unlocked, I want to have a menu such as 'Level Select', where at any time that player can choose to replay a level they have completed.

    So you see, game.level+1 works if they start from the first level every time, but not if they decide to play through any other level straight up.
    Does that make sense?

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    It makes sense but so does what I said earlier:

    If you have a button that says "Level 6" then in that actor you need to have a rule that says When Touch is Pressed, Change Attribute game.level to 6.

    So on your Level Select scene, make sure that the "Level 6" button changes game.level to 6.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • Chr0nosChr0nos Wondering Vagabond AustraliaMember Posts: 113

    Ok cool, that will work for the 'Level select' scene, but what about the 'Next level' button that comes up on the pause screen after you have finished a level? At the moment I have the 'Next level' button programmed with game.level+1 and if you start on say, level 5, after completing that level the next level button will take you back to level 2 instead of just taking you to level 6.

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    It seems like we're going round in circles. I'm not sure how else to explain it. If a player starts on level 5 then game.level will be 5... right? Because the "Level 5" button on the Level Select scene has Change Attribute game.level to 5 in a When Touch is Pressed Rule. The only way the Next Level button will take you to level 2 is if game.level is equal to 1. But it won't be. It will be 5. So when you complete level 5 and press the Next Level button, it will change game.level to 6 (5+1) and change the scene to the level 6 scene.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    Here's an updated demo that allows you to start at level 5 and advance to level 6. Note that not all of the levels function correctly. I just threw this together to show you levels 5 & 6.

    I'm going to sleep so hopefully this helps demonstrate what I mean.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • Chr0nosChr0nos Wondering Vagabond AustraliaMember Posts: 113

    Thank you very much!

Sign In or Register to comment.