Game Development Reference
In-Depth Information
You can simply copy and paste the main menu button behaviors and simply change
the level to the one you want to load to, or you can do an unlocking system like I did.
Here's how to do it:
1. In your scene, create a new attribute in the Inspector section under the
Attributes tab, make it a Boolean , and name it according to the level it will
unlock, for example, Level1Complete .
2. Now open up the first button (or whichever button you want), and let's
create a new rule. Change it from Actor receives event to Attribute . In the
box beside the drop down, click on the ellipsis ( ) button, this will open up
the Attribute Browser section.
3.
Then click on Game | Level1Complete or whatever you named it, and make
sure it's set to is | true . To make things a little more organized, let's name
this rule so we can distinguish it from the other one we will create. Double-
click on the Rule title, and rename it to Completed .
4.
Within that rule, you can paste in the main menu behaviors, or just recreate
them by creating a new rule inside of that rule (by clicking the Create Rule
button at the top of the screen, and clicking and dragging it inside the
Completed rule).
5.
Change this rule to Actor receives event | touch | is | inside , then drag in a
Change Scene behavior inside.
6.
Now drag in a Display Text behavior inside the Completed Rule, but not
inside the touch rule we just created. Change the text to the name of the level,
and change the color to white. (We are going to make disabled buttons have
black text so you can tell it's disabled.)
7.
Create a new rule outside of the Completed rule, and name this one
Disabled , or Unavailable , or something to that affect. Change it to
Attribute | game.Level1Complete | is | false . Then just drag in a Display
Text behavior (or copy the last one), and change the text color.
 
Search WWH ::




Custom Search