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 3
Download
20 KB


Goal:   Type in your questions and control how your words look.


Screenshot


Vocabulary:   ct (cleartext), setfont, setfontsize, settc, opaque, transparent, select, top, bottom, wait, startup

Code
Shapes
Project Map

to startup
opaque "text1
text1, ct
      setfont "Arial
      setfontsize 14
      settc 9
end

to erase
startup
end

to shake
opaque "text1
text1, top
select
bottom
settc 30
transparent "text1
wait 3
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. Startup is a special procedure name.   The computer will run the startup procedure as soon as the project opens.

  2. Opaque "text1 means, "Make the text box white and solid."
    Transparent "text1 means, "Make the text box transparent" so we cannot see the box, only the writing.   We can only write in opaque text boxes.   But sometimes it looks nice to make a text box transparent after we have written in it.   (You can also make a text box transparent by selecting it and checking the "transparent" box.)

    Text1, (with the comma) means, "I am talking to the text box named text1."   This is helpful when you have more than one text box on the page.
    Ct means, "Clear the text," or "erase the text."
    Setfont "Arial tells the computer what the letters should look like (in this case, the Arial font).   Choose a common font that is found on most computers.
    Setfontsize 14 tells the computer how large to make the letters.
    Settc means "set text color."Settc 9 sets the color of the letters to black.

  3. Settc 30 sets the color of the letters to off-white.   After we type our question, we will turn the letters almost white and make the text box transparent.   But first we need to select all of the words we have typed.   We use these commands:
    Top moves the cursor (the flashing line) to the very top and left corner of the text box.
    Select begins selecting part of the text.
    Bottom moves the cursor to the very bottom right corner of the text box.
    Top select bottom means that every word in the text box is selected and can be changed by the next command(s).
    Wait 3 gives a small pause before the next command is run.   We can be sure to see the question turn white before the ball shakes.




What If?
What happens if you type setfont "|Courier New| in the startup procedure (or if you place another font name between the vertical bars)?
What happens if you put another number after setfontsize or setc?


Challenge
Try changing the color of the words just before the text box becomes transparent.
Can you also change the font and size of the words just before the text box becomes transparent?


On Your Own - Project Ideas
Try adding other commands to the startup procedure.
Try designing other fortune-telling shapes which can carry messages instead of an 8-ball: what about a crystal ball, or a small deck of cards? Can you give your new shapes a realistic animation?





© copyright 2001 - 2016  OpenWorld Learning.   All rights reserved.