Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

How to make levels and objects lock and unlock

ChucklingMonkeyChucklingMonkey Posts: 92Member
edited 1:43PM in Working with GS (Mac)
Hi Everyone,
How would you make levels lock, and when you beat the one before it it will unlock so you can now play that level? Same with objects; when you earn a certain amount of coins, certain objects will unlock?



  • AppsterAppster Posts: 112Member
    Hey C.Monkey, you can use attribute to save and load attribute to determine lock or unlock. Good luck!

    Appster - List New GS Games Here
    Mathstar Pro
  • giacomopoppigiacomopoppi Posts: 914Member, PRO
    Yeah, make an attribute (levelReached - Integer)

    In the level:
    Create rule
    when you beat level
    change attribute levelReached to ?? (level)
    save attribute Game.levelReached - key lvl (example)

    Home screen
    Load attribute Game.levelReached - key lvl

    Level selection screen
    On each level Icon (level 1,2,3,4...ect)
    Create rule
    If attribute game.levelReached >= level icon value
    Change attribute SELF.unlock (create self attribute here) to 1
    change image - to an image without the lock

    Create rule:
    when self.unlock = 1 + recieves touch
    change scene- level ??

    Done, hope i helped ;)
This discussion has been closed.