Unlock a level when the previous one was completed?

mvsprojects

  • Posts: 71
I would like to know how I can be able to make a level unlock when you have won the previous level. Can that be achieved?
Boing Ball coming soon...
Co-Opetative coming soon...

MV's Projects- Something to Enable

rob1221

  • *
  • Posts: 9472
Yes, you can use a game attribute list and when your previous level is completed, change the value representing the next level and change the animation to unlocked on your level select screen.

mvsprojects

  • Posts: 71
How, though, would I figure out the "design mode" code for it when a level is completed?
Boing Ball coming soon...
Co-Opetative coming soon...

MV's Projects- Something to Enable

Ceric

  • *
  • Posts: 610
That depends on what happens in your game when the player completes a level. Do they get an item? Do they go through a door? Do they have to touch a switch?

As for the code for switching to the next level when the Game Attribute is flipped to true, here you go.

Ceric

  • *
  • Posts: 610
FYI to "unlock" a new level, do you want it to be visible from some kind of menu that the player can select from or do you just want the player to be able to go there from where they currently are?

Regardless, you'll be switching a boolean Game Attribute (LevelOneCompleted? or something similar that you make) to true, and then the "entrance" to the new level won't work unless that "LevelOneCompleted?" attribute is true.

mvsprojects

  • Posts: 71
Yes, there is a level select, but you can continue from where you are, unless you want to go back to the level select.

« Last Edit: November 28, 2011, 06:04:44 pm by mvsprojects »
Boing Ball coming soon...
Co-Opetative coming soon...

MV's Projects- Something to Enable

Ceric

  • *
  • Posts: 610
Okay, well the behavior image I have posted above will work. How does the player complete a level?

mvsprojects

  • Posts: 71
The player has a ball touch a goal and then a so-called win image appears.
There, you have an option to either go to the main menu or go on to the next level.
Boing Ball coming soon...
Co-Opetative coming soon...

MV's Projects- Something to Enable

Ceric

  • *
  • Posts: 610
You would need a couple different behaviors for this, but what they are would depend exactly on how you want your victory win image and level selection to work.

For example, for the "win image," do you want that to be a new scene or a pop-up graphic that's in the current scene?

Also, do you want the option to go to the main menu or the next level to appear on the win image itself, appear as a different pop-up menu after the win image fades, or do you want the win image to be a whole new scene that gives the player the option?

Based on how you want to do this, the blocks you use will be different. You would use the "create actor" blocks to make pop-up menus appear (and then attach a behavior to the actor you're using for the pop-up menu), but if you're using different scenes, you would use the "switch scene" blocks and in the new scene have a behavior attached to it that shows the menu.

In a lot of ways, Stencyl's Design Mode is like regular programming - there are a lot of different ways to accomplish the same kind of thing. There isn't really a "right" way to do something, necessarily.

FYI I can show you how to do these things either way, but you would need to choose the exact things you want to happen and in what order.

Ceric

  • *
  • Posts: 610
FYI here's an example of a very simple behavior that you would attach to the "goal" actor. It simply switches to the next scene when the player actor touches the goal.

I can help with the rest of what you're trying to do if you can decide on the exact things you want to happen (based on my post above) and in what order.

mvsprojects

  • Posts: 71
For the "win image," do you want that to be a new scene or a pop-up graphic that's in the current scene?

Also, do you want the option to go to the main menu or the next level to appear on the win image itself, appear as a different pop-up menu after the win image fades, or do you want the win image to be a whole new scene that gives the player the option?

It will be a pop-up graphic.

Also, it will appear in the win image itslef, but as separate actors.
Boing Ball coming soon...
Co-Opetative coming soon...

MV's Projects- Something to Enable