[PLEASE ENABLE JAVASCRIPT TO SEE THIS]
Home Project Folders Resources How Do I? MWForum
Site Map Search Our Team

fortune telling
 1 
 2 
 3 
 4 
 5 
 6 
Fortune Telling 2
Try It
77 KB


Goal:   Shake the ball and find out the answer to your question.


Screenshot


Vocabulary:   seth (setheading), random

Code

to shake
t1, repeat 10
      [
       setsh "8-ball
       seth random 360
       fd 15 bk 15
       setsh "8-ball-t
       fd 15 bk 15
      ]
setsh pick [sure! of_course! please_ask_later totally! nope yes! no no_way right_on duh!]
end



Project Map Shapes

Project Tab


Notes

Seth stands for "set heading" and is always followed by a number.   Seth 0 points the turtle straight up.   Seth random 360 means, "Choose any number from 0 to 359 and point to that heading."   (There are 360 degrees in a circle, so the turtle might point in any direction.)

In the shake procedure, the magic 8-ball shakes a little bit before giving an answer.



What If?
Try different numbers after fd and bk.
What happens if the numbers are all the same?
What happens if the numbers are different?

Challenge
Experiment with other variations on the procedure to get a different jiggling effect:
Try changing the number after seth random or omitting that command.
Try including wait 1 in one or more places.
Try alternating between two shapes which are identically-sized.

On Your Own
Instead of moving the ball forward and back, try making the 8-ball shape appear to spin.   (See "Animate Me 5" for instructions on how to create rotated versions of a shape and include them in a procedure.)



© copyright 2001 - 2006  OpenWorld Learning (OWL).   All rights reserved.