well you can just make a boolean variable within the world (do not make it in the method itself) and call it nightVisionOn. It could initially be turned to false, but then when you click a button (lets say space) it runs the method enableNightVision.
Within this method you can have an if/else statement saying (if(nightVisionOn)) and then in that if you make the method to turn it off, and then in the (else) you can have the method to turn night vision on. At the end of the if statement, you simply add a command to turn nightVisionOn == false, and then at the end of the else statement have nightVisionOn == true.
Now every time you run the method, depending if nightVisionOn is true or false, it will have a distinct method, but both will be triggered by pressing the space bar. If you need more help, just ask and I will create a world with the example.
Check out my best projects so far and please comment:
Tic-Tac-Toe 2.0 ................... http://www.alice.org/community/showthread.php?t=3548
Alice Paint ........................... http://www.alice.org/community/showthread.php?p=23408
Real-Time Clock .................. http://www.alice.org/community/showthread.php?p=12725
Maze Game ......................... http://www.alice.org/community/showthread.php?t=4301
Ok here is an example I made. It starts out as night with night vision off, but then when you click space the night vision goes on. When you click space again, the night vision turns off.
Click on the variables tab in "world" to see the boolean I created, and in the method, I made the boolean change to either true or false so that the next time the method is called it will do the opposite. The boolean is like a switch that gets turned on and off.
Check out my best projects so far and please comment:
Tic-Tac-Toe 2.0 ................... http://www.alice.org/community/showthread.php?t=3548
Alice Paint ........................... http://www.alice.org/community/showthread.php?p=23408
Real-Time Clock .................. http://www.alice.org/community/showthread.php?p=12725
Maze Game ......................... http://www.alice.org/community/showthread.php?t=4301
A simpler way to set this up would be when space is typed, set your night vision variable to not(your night vision variable. First just have it set the variable to itself, and then right click the variable in the second part of the command, and set it to logic>not variable. This combines the statements, and saves memory as well as screen space.
'Apple Macintosh' - An anagram of 'Complaints Heap'
M.A.C.I.N.T.O.S.H. - Machine Always Crashes, If Not, The Operating System Hangs.