Quote:
Originally Posted by Retyping
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!
|
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.