pygame: Olympic Rings

Graphics and Animations – Chapter 17

Homework:
Complete assignments

Classwork:
1. Write a python/pygame program, Olympic_Rings_YI.py. Draw the Olympic rings like the ones below.
Try to match up the colors and the relationship between the rings.

olympic_rings

Link for antialiased circles.
This link has more drawing options.

anti-alias

2. Write a pygame program, Cars_n_trucks_YI.py to draw a random number of different cars and/or trucks of different colors. Look at some examples bellow.
Draw composite basic shapes

Screen Shot 2014-02-26 at 5.49.41 AM Screen Shot 2014-02-26 at 5.49.46 AM Screen Shot 2014-02-26 at 5.49.54 AM Screen Shot 2014-02-26 at 5.50.01 AM

car3

truck4

Note 1: make them (at least 2 kinds of vehicles) colorful and filled in.
Note 2: create functions: drawCar and drawTruck. Both functions should take two parameters: the scaling factor (suggested factor should be less than 1) and translation constant so it can be placed in different locations. For translation only, the scaling factor should be 1 and for scaling only the translation constant should be zero.
Note 3: the cars and trucks should be placed on the surface in random locations.
Note 4: Keep on reading chapter 17

Geometry review:
Dialation:
Screen Shot 2016-02-22 at 8.14.05 AM

Translation:
Screen Shot 2016-02-22 at 8.16.36 AM