Alice Community

Alice Community (http://www.alice.org/community/index.php)
-   How do I...? (http://www.alice.org/community/forumdisplay.php?f=16)
-   -   Stopping a moving object with a switch (http://www.alice.org/community/showthread.php?t=12260)

Mac1357642 08-02-2020 01:33 PM

Stopping a moving object with a switch
 
I'm trying to make a stop moving when the mouse clicks the red button. I got it to drive when the green button is clicked but can not get it to stop with the red button. It just finishes it's rotation of the track. Can anyone help?

djslater107 08-03-2020 12:29 PM

Using a Boolean variable to control action
 
Create a boolean world variable, set it to false, and name it something like isActive.

You probably have a while loop controlling the drive around the track. That loop should be
while isActive
drive

When you click on the green button set the isActve variable to true

When you click on the red button, set the isActive button to false


All times are GMT -5. The time now is 03:25 PM.

Copyright ©2024, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.