Home
Project Folders
Teacher Resources
Student Resources
En ESPAÑOL
How Do I?
Vocabulary
MWForum
Site Map
Search
Our Team

fortune telling ball 1 2 3 4
Fortune Telling Ball 2
Download
20 KB


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


Screenshot


Vocabulary:   seth (setheading), random

Code
Shapes
Project Map

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



Notes

  1. 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 - Project Ideas
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 - 2016  OpenWorld Learning.   All rights reserved.