Alice Community  

Go Back   Alice Community > Alice 2 > How do I...?

Reply
 
Thread Tools Display Modes
Stopping the Ferris Wheel
Old
Retyping
Junior Member
 
Status: Offline
Posts: 1
Join Date: Mar 2018
Default Stopping the Ferris Wheel - 10-21-2018, 03:35 PM

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!
Attached Files
File Type: a2w FerrisWheelWontStop.a2w (257.6 KB, 2 views)
   
Reply With Quote
Tada!
Old
Dehixial
Junior Member
 
Status: Offline
Posts: 10
Join Date: Oct 2018
Talking Tada! - 10-25-2018, 08:26 AM

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
Attached Files
File Type: a2w ferrisWheelSolved.a2w (262.0 KB, 1 views)
   
Reply With Quote
Old
chickentree
Super Moderator
 
Status: Offline
Posts: 250
Join Date: Dec 2012
Location: Frosno, Ca
Default 10-29-2018, 07:20 PM

Quote:
Originally Posted by Retyping View Post
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.
Attached Files
File Type: a2w ferrisWheelAns.a2w (263.5 KB, 7 views)


Mark Henwood
mhenwood@ieee.org
   
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



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