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.
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
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.