Alice Community

Alice Community (http://www.alice.org/community/index.php)
-   How do I...? (http://www.alice.org/community/forumdisplay.php?f=16)
-   -   Circle Track (http://www.alice.org/community/showthread.php?t=3980)

TaraLaukart 02-24-2010 08:43 PM

Circle Track
 
How do I make an object stop moving?

I have an object moving on a loop when I click a button and I need it to stop when I click the other button.

x2495iiii 02-24-2010 09:11 PM

Try using a boolean variable which sets itself to true when the go button is clicked and to false when the stop button is clicked. Then use the boolean with a while loop to let the loop stop when the variable is false.

Be sure there's something that calls the method with the while loop in it, though. Otherwise, the object won't move whether it's true or not.

jediaction 02-25-2010 07:33 AM

[QUOTE=TaraLaukart;17506]How do I make an object stop moving?

I have an object moving on a loop when I click a button and I need it to stop when I click the other button.[/QUOTE]


In my words

Make a boolean like X said
Make the loop
Put the loop in a if/else statement
Make sure its at false in the "true" section
make it so when you click the button the false sets to true
So if you if you click the button, if the boolean is treu, it will stop

If you want me to make an example. Ill do it in 5 minutes ok

Mac1357642 08-02-2020 01:37 PM

Help?
 
I have the same issue. Can someone break it down into more steps? I have trouble with variables.


All times are GMT -5. The time now is 12:19 AM.

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