View Single Post
Old
chickentree
Super Moderator
 
Status: Offline
Posts: 250
Join Date: Dec 2012
Location: Frosno, Ca
Default 05-10-2015, 03:10 PM

Quote:
Originally Posted by RavenOfCode View Post
My way works...

This took me about 3 mins to make...

Following what I had said

Calculate the spinner variable first then turn it accordingly...
Yep, it is better than either of mine. I hadn't thought of using just one initial position but it is a lot nicer solution. But the problem with the test.a2w John316 submitted shows a couple of other problems.
John316, you should understand that making the spinner spin is just appearance, smoke and mirrors, eye candy for the program. It is a way to show the user what the result of the spin was. Alice seems to let you compare poses but it doesn't work correctly and even if it did you are comparing two poses without regard to where the arrow is actually pointing. Your "if" statements will do the "if" part every time regardless of the pointers location.
As RavenOfCode said in a previous post, you want to use a variable to hold the value returned from "random number" (Raven used world.spins in the code he posted.) You then use the value of world.spins to both position the arrow on the spinner and to move the character forward.
One more thing, the "Boy" you are using has a walk method. If you call Boy.walk(world.spins) the boy should walk that number of steps.

Mark


Mark Henwood
mhenwood@ieee.org
   
Reply With Quote