Alice Community

Alice Community (http://www.alice.org/community/index.php)
-   How do I...? (http://www.alice.org/community/forumdisplay.php?f=16)
-   -   Stopping the Ferris Wheel (http://www.alice.org/community/showthread.php?t=12130)

Retyping 10-21-2018 02:35 PM

Stopping the Ferris Wheel
 
1 Attachment(s)
I am working on a textbook assignment with a ferris wheel using a while statement.

Ultimately, I'd like for when the button is pressed to turn green and the ride to continue. Once ANYTHING else is clicked other than the button I would like the ride to stop. However, I'm extremely confused as to how to get this animation to stop.

Could someone give me a bit of feedback?
Thanks!

Dehixial 10-25-2018 07:26 AM

Tada!
 
1 Attachment(s)
Sorry i'm extremely late, but i have a decent solution. I'm not the best with ALICE, but here's my take. The only thing is, clicking the button a second time doesn't shut it off.

Its not too smooth either. Anyone else, or you, feel totally free to change it, but enjoy :)

chickentree 10-29-2018 06:20 PM

1 Attachment(s)
[QUOTE=Retyping;58507]I am working on a textbook assignment with a ferris wheel using a while statement.

Ultimately, I'd like for when the button is pressed to turn green and the ride to continue. Once ANYTHING else is clicked other than the button I would like the ride to stop. However, I'm extremely confused as to how to get this animation to stop.

Could someone give me a bit of feedback?
Thanks![/QUOTE]

The reason the ferris wheel won't stop is because in your ferrisWheel.ferrisWheelAnimation method you use a "while true" block. This will cause whatever is inside that while to run forever after it is started. The easiest way to do this is with an event called "while something is true" and then use a boolean to turn the ferris wheel on and off.


All times are GMT -5. The time now is 07:49 AM.

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