Locking Levels
KempProductions
Member Posts: 139
I know this has been asked before, but I searched through the forums, and I couldn't find it where I had seen it before. But I need help being able to lock a level in a "Level Selection" scene. And also putting a padlock or something over the Level image when it is locked.
Comments
Then create a padlock actor. Drag a copy of this actor on top of all of your level select buttons.
Create an integer attribute inside this actor called "myLevel". Leave it at 0.
Create a Rule in the padlock actor like this:
Rule
When game.currentUnlockedLevel >= self.myLevel
Destroy
Then, in each of the instances of the padlock on the stage, double click on it and edit the myLevel attribute to be the appropriate number.
The buttons themselves will need a similar setup.
A myLevel attribute and a rule:
Rule
When game.currentUnlockedLevel >= self.myLevel
Go to Appropriate Scene
I have a global integer game attribute set to 1.
I have my "Locked" actor, with a integer attribute 'myLevel' set to 0. Then a rule in that actor like you said.
But when i preview, that "Locked" actor doesn't show up.
Doesn't there need to be something in each scene?
double click on each lock to set it
Save Attribute
game. currentUnlockedLevel To Key: CURRENTUNLOCKEDLEVEL
Then, on the very first scene in the game, BEFORE the level select screen - Ideally on a scene that only appears once, like a splash screen, or your logo scene - you use the load attribute behavior, like this:
Load Attribute
game. currentUnlockedLevel From Key: CURRENTUNLOCKEDLEVEL
I didn't realize my game was similar to Danger Cats! , now people will compare mine to yours, so I don't know how good mine will do, because your game is amazing.
Well, they are both based on Totem Destroyer and similar games...
I just wanted my game to have a slightly different theme, so it would stand out from the crowd...