D – 8: Using Python Turtle module to draw animated figures
Assignment 8 – A. Rotating Rectangles
The following figure shows some sample examples of the animation. Write a program that draws a series of rectangle rotated by an increasing amount. You can use the following outline of steps to draw the animation.
- Set heading direction to zero
- Clearscreen
- Drawrectangle
- Pause 1 second
- Increase direction by a set amount
- Repeat steps B – E
Assignment 8 – B. Twinkling Stars
Write a program that draws a random placement of stars. Use random positions, random headings, and random colors to draw the stars. Use the following outline to create the animations.
- Set heading direction to zero
- Clearscreen
- Generate random x, y coordinates (between -300 and +300) and set position
- Generate random R, G, B numbers (between 0 and 255) and set color
- Generate random heading for direction (between 0 and 360) and set heading
- Draw star
- Pause 1 second
- Repeat steps B – G