|
MicroWorlds |
Buttons can make things happen. We will create two buttons to allow us to switch from day to night and back again.
2 Click on the page where you want the button to appear. A dialog box will appear. Type Day in the box.
4 |
5 |
"I don't know how to day"
Day is not a command that MicroWorlds understands. This word will be added to its vocabulary. Day will change the sky colour to blue and night will change the colour to black. First though, type this in the Command Center.
setbg "sky |
Setbg stands for set background. |
Choose procedures from the pages menu. The procedures page is the place where the procedures (programs) are written. A procedure is a list of instructions to which a name is given. Once a procedure is defined, typing its name is like typing all the instructions it contains. |
to day
setbg "sky
end
to night
setbg "black
end
Now return to your page (Page 1).
Select your page name from the pages menu.
Now try the two buttons.
If the buttons don't work, you may have used the paint can to colour in the sky. Setbg can't colour over it. Use the eraser in the Drawing Center to erase the coloured sky and then try the buttons again.
Save you project in preparation for Typing Text.