lab6

Lab 6 Write-up

Task:

The task for this project was to create an animated scene using the features available in the Zelle graphics package. We also were required to incorporate every object from the Zelle graphics package into the scene

Image from demotest.py:

Image from Cityscape2.py

Description of Loops and parameterization

In order to create the snowflakes, I used a for loop instead of drawing each circle individually, which would certainly take much more time. In the for loop I used the range function to draw the snowflakes with respect to both the x and y axes. I then used another for loop to create a list with each circle in it.

In order to animate the snow I used another loop. The for loop has two states. The first state draws half of the snowflakes. The second state then undraws the snowflakes that were previously visible, and then draws, the half of the snowflakes that were not previously visible. So each change of state draws half of the snowflakes, and undraws the other half.

I used parameterization for my buildings so that I would not have to keep re-writing the code that has the images for the building. Instead, I made one building function and each time I wanted to draw a building, I just called the function and gave it an x0 value, an y0 value and a dx value.

Where I used each Zelle Graphic:

The point graphic is necessary to create nearly all of the other Zelle graphics

I used the line graphic for the stop sign pole

I used the circle graphic for the snowflakes

I used the polygon graphic for the triangle

I used the oval graphic for the stop sign

I used the image graphic to import the picture of the mountains

I used the text graphic to write stop on the stop sign