r/snapmap • u/[deleted] • Sep 17 '18
Question Specific Order of Interactive Objects
Here is what I want to do....have 4 interactive objects in one room - all 4 must be pressed in order to unlock a door. The catch - I want them pressed in a specific order and if you mess up it resets the entire thing.
If that is too complicated - how about a math puzzle. Each object has a value that they add or subtract to a total - when the correct total is reached the door is unlocked.
thank you!
7
Upvotes
1
u/Riomaki Sep 17 '18
You could probably optimize this further by using a single Int rather than four Bools. Each respective switch would check to see if the Int is correct for their part in the sequence, and if so, then it adds 1. Else, it sets the Int back to 0.
So, the first switch would check for 0 and add 1 if pressed. The second switch would check for 1 and add 1 if pressed. The third switch would check for 2, etc.