' Draw the Grass LINE (0, 300)-(150, 280) LINE (320, 280)-(510, 290) LINE (540, 295)-(640, 300)
The illustration shows the complete picture (reduced in size.)
The picture is now complete. All the tasks have been completed. But the picture could be improved by using color. We would like the house to be drawn in white (as it is), the grass and leaves to be green, and the trunk to be brown. To set the color use:
COLOR colorNumber
where the colorNumber
is a number 0 to 15.
The color remains set until you change it with
another COLOR
statment.
Here is a table of colorNumbers
(repeated from a previous chapter):
Color Number | Color | Color Number | Color |
---|---|---|---|
0 | Black | 8 | Gray |
1 | Blue | 9 | Light Blue |
2 | Green | 10 | Light Green |
3 | Cyan | 11 | Light Cyan |
4 | Red | 12 | Light Red |
5 | Magenta | 13 | Light Magenta |
6 | Brown | 14 | Yellow |
7 | White | 15 | Bright White |
Here is the complete program:
' House Picture ' ' Start Graphics SCREEN 12 ' Draw the House ' Draw the Walls LINE (150, 320)-(150, 200) LINE (320, 320)-(320, 200) ' Draw the Floor and Ceiling LINE (150, 320)-(320, 320) LINE (150, 200)-(320, 200) ' Draw the Roof LINE (150, 200)-(235, 100) LINE (320, 200)-(235, 100) ' Draw the Tree ' Draw the Trunk LINE (510, 400)-(510, 240) LINE (540, 400)-(540, 240) ' Draw the Leaves CIRCLE (525, 160), 80 ' Draw the Grass LINE (0, 300)-(150, 280) LINE (320, 280)-(510, 290) LINE (540, 295)-(640, 300) END
Add COLOR
statements to the program so that
the objects are drawn in the desired colors.