In Lesson 8.11 we added parameters to the drawStar function. In this lesson we'll do the same for the drawGrass function, so that we can easily draw it in different locations. Load your saved file from Lesson 8.11. (Click on the "File" button" at the top left of the RoboBlockly window. If you can't find it, it may be because you didn't choose the "save file to cloud" option when saving it. If so, we have pre-placed the code from Lesson 8.10, but you will have to modify both the drawStar and drawGrass functions. In addition, future lessons won't provide the code, so make sure you are saving your work to the cloud!)
|
Grid Size: S M L | Simple View: | MinView: |
|
Coord: x-axis y-axis | Grid Lines: x-axis y-axis | |||
Grid: | 12x12 inches | 24x24 inches | 36x36 inches | |
72x72 inches | 96x96 inches | 192x192 inches | ||
1x1 inches | 2x2 inches | Fraction: | ||
xy-Range: | ||||
|
||||
|
||||
Quad: | 1 Quadrant | 4 Quadrants | 1&4 Quadrants | |
Units: | US Customary | Metric | Ruler: |
Labels: |
|
|
|
Font
px
|
|
Tics Lines: |
|
Width
px
|
Hash Lines: |
|
Width
px
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
|
Using the drawFish and drawStar function definitions from Lesson 8.11 as a model, modify the drawGrass function so that it has two parameters, named grass_x and grass_y, that specify the (x, y) location for the grass. Then add function calls to your program to draw grass in several locations. If you get stuck, see the Hint, and don't forget to save your work to the cloud in an xml file named "YourName_Lesson8.12"! |
|
|
|||||||||||
|
|||||||||||