Alice Community Creating a spinner

 Or- Don't be a Poser
MrMoke
Senior Member

Status: Offline
Posts: 501
Join Date: Sep 2007
Location: Austin, Texas
Or- Don't be a Poser - 05-10-2015, 05:23 PM

Just remember that poses are not always an efficient solution to a programming algorithm, and that there are many other viable solutions. The attached proggie uses only a single array, and the positions of the objects in the array to generate a random number of steps.

I left a key item visible so that you could see what's going on, but it can easily be made invisible. There is also no need for a function because the stepcount variable is global.

The two code blocks are disabled, so you can enable the first to view it, then disable it and enable the second to run the test.

Collisions are sometimes good for you
Attached Files
 spinner.a2w (337.6 KB, 3 views)

 Thank You
 john316 Junior Member   Status: Offline Posts: 10 Join Date: Apr 2015 Thank You - 05-10-2015, 05:55 PM Thanks for the help. Thank you for being so patient. 1 last question. Because the boy will be on a game board he needs to move each square. To land in the middle of each square he must move .31 meters. How do I set it so so that he will that distance( .31 meters) ''x'' amount of times (whatever number the spinner lands on) ? Thanks again.
 MrMoke Senior Member     Status: Offline Posts: 501 Join Date: Sep 2007 Location: Austin, Texas 05-11-2015, 08:06 AM The number that's passed back is the multiplier.
RavenOfCode
Senior Member

Status: Offline
Posts: 408
Join Date: Oct 2013
Location: Northern Virginia
05-11-2015, 05:21 PM

Quote:
 Originally Posted by MrMoke The number that's passed back is the multiplier.
ie: .31 * spins (or whatever variable you are using).

Also Mr. Moke your example is really a creative idea... I like your use of arrays...

Stuff + Other Stuff + Different Other Stuff = Things :)

My best Alice game:

Clash of the Cubes (an arena fighting game):

Last edited by RavenOfCode; 05-12-2015 at 06:08 AM.

 Can I get a repost?
 offbraxton Junior Member   Status: Offline Posts: 1 Join Date: Dec 2019 Location: Mena Can I get a repost? - 02-18-2020, 01:10 PM I am helping my son learn to code and this project has us stumped could I get a reupload of the file so I can make sense of it and show him?

 Tags spinner

 Thread Tools Display Modes Linear Mode

 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 Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home Announcements     Community News and Announcements Alice 3     How Do I?     Works In Progress     Share Your World     Share Custom Classes     Bugs and Trouble Shooting     Suggestion Box Alice 2     How do I...?     Works-In-Progress     Share Worlds     Share Objects     Bugs and Troubleshooting     Suggestion Box Educators     Teaching with Alice     Teaching Using Alice 3     Teaching Using Alice 2     CS Principles and Alice     AP CSA and Intro to Java and Alice     Workshops General Discussion     Questions and Comments     The Lounge