Forum Discussion
Revert state of object back to original state, with a click
Laura,
I was imagining the object having only two options, like the "Selected State" rectangle or the "Change Variable to Correct" textbox in the attached sample.Those are really simple, all you have to do is create the desired "Selected" state, and let it exercise its native superpower (provided you name it "Selected".)
What you want is complicated by having three states, Normal, Incorrect, and Correct. To do that, you need a third character; a dispassionate observer to inform everybody what the current state of the object is. That can be easily done with a T/F variable, which can be toggled (have its value switched to which ever one it isn't). That is also the principle behind the selected state; you don't have to check which it is, it just changes to the other one.
I could have set the "Click Me" box to do that with only two states. For me the real challenge is knowing when it is clicked whether the click is correct, or not. I settled on an independent variable that is set to True or False. Depending on that value, and the current condition of the "Click Me" box, its state changes. The value of the Correct/Incorrect variable is changed by clicking the "Change variable text box.
Try them all and read their triggers and you'll be on your way.
Related Content
- 9 months ago