Changing states of objects is not working when clicked 2x+
Apr 24, 2014
I'm creating a game where users will click an object that has a normal and inverted state. I want the user to be able to click the object initially in the normal state to change it to the inverted state, click it again to return to the normal state, and continue if necessary until their design is as desired. I have tried setting up the state triggers and variables a bunch of ways, and I can get it to switch to the inverted state, but never return back to the normal state.
After the user would create their design on the right, they will drag the big block on the left on top of it to discover their secret letter. This part works fine, but I want them to be able to continue to fix and modify their design on the right block by clicking each object and switching states.
The selected object and states are shown with the first two triggers related to it on the right below Object Triggers.
Help!
13 Replies
Hey Mary!
Use true/false variable to change states...for example change state to inverted when user clicks if variable value is true....change the state to normal when user clicks if variable value is false.
I would just use the built-in Normal and Selected states. Since these are built-in states, they toggle automatically, everytime the object is clicked. No triggers needed.
Okay, I still can't get it to work. When I add the change it back to normal trigger, it doesn't work.
I created two variables: BlockVariable1N with a value of 0 and BlockVariable1I with a value of 1.
Then, I added the triggers as shown in the Object Triggers pane, but that's not working.
Do I need to link the states of the object (normal and inverted) to the variable? How do I do this?
Thanks Micheal Hinze! That did the trick. This is AWESOME! Doing Normal and Selected states worked perfectly with no trigger needed, as you described. Thank you so much for the help! I have a ton of games I want to create using this trick
Brilliant Michael!.....U added something new to my knowledge....much appreciated.....Thank u!
Hi, Mary!!!
I want to see your course. I think it is very interesting.
Hi Michael Hinze,
Thanks! Here is a link to the game. Hope you enjoy it. I may have to make more changes after doing more testing.
http://stemread.niu.edu/files/games/Cryptography/story.html
Thank you Svetlana
Hassan, thank you for your help as well. I now better understand variables.
U r welcome Mary! N thnks to u as well....I understand states better now.
Thanks Mary for sharing here - such a fun course!
Thank you all. I just made some additional changes, so hopefully it works well now. I look forward to creating lots of new stuff with the new things learned.
This discussion is closed. You can start a new discussion or contact Articulate Support.