puzzle logic help.

I want to include a puzzle into my game that I've seen done on other apps but not sure if possible with game salad.

I want to have three light switches that activate a door open only when they pressed in the correct sequence. if the user gets the sequence wrong the sequence resets. For example out of three switches (1st-2nd-3rd) the user would need to select the switches in this order (2nd-1st-3rd) in order for it to be a success. any idea on how to go about something like this? I thought about using tables some how but i don't have very much experience with that. thank you!

Comments

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

    It's actually very easy. Make a text attribute called game.sequence. When touch is pressed, change game.sequence to game.sequence..self.number (where self.number is an integer set to the value of that switch: 1, 2, or 3). Then have a rule in a separate actor that says When attribute game.sequence is "213" [unlock the door]. If they make an incorrect sequence, reset game.sequence (you can check by counting button presses or checking the text attribute length) to "" (an empty string).

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

  • Hipster_Owl_StudiosHipster_Owl_Studios Member, PRO Posts: 214

    Thank you so much.

Sign In or Register to comment.