In this lab, you will write your first program to draw some simple shapes on the stage.
-
Modify your program from the do now activity to draw a triangle when the number 1 is pressed on the keyboard.
-
Modify your script so that the sprite says the word "triangle" while it draws. The sprite should stop saying "triangle" once it has finished drawing.
-
Modify your script so that pressing the space bar clears the pen marks from the stage.
-
Now that you've drawn a triangle, add scripting to draw the shapes in the following table. Each shape should be drawn when the number next to it is pressed on the keyboard. (For example, pressing 3 on the keyboard should draw a diamond.)
When this key is pressed... Draw a ... 1 Equilateral triangle 2 Square 3 Diamond 4 Pentagon 5 Parallelogram ("leaning rectangle") 6 (optional) 5-pointed star You may want to draw a diagram like the one above of a triangle to figure out the angles in each shape.
-
Modify your script so the sprite is saying the name of shape. The sprite should stop saying the name of the shape when it is finished drawing.
-
Modify your script so that each different shape is drawn in a different color and with a different line thickness. For example, if the square is drawn in blue with a line thickness of 3, each other shape must be drawn in a color that is not blue and with a line thickness that is not 3.
-
Modify your script so the sprite is hidden when it is not drawing. This will ensure the sprite is not obstructing the view of your beautiful artwork!
-
Save your project as Lab1.3.
Criteria | Points |
---|---|
Equilateral Triangle | 0.25 |
Square | 0.25 |
Diamond | 0.5 |
Pentagon | 0.5 |
Parallelogram | 0.5 |
Star (bonus!) | 0.5 |
Total | 2.0 |