Chp 5 Create a picture

Your assignment: Draw a pretty picture. The goal of this lab is to get practice using functions, using for and while loops, and introduce computer graphics.

Requirements:

  • You must use multiple colors.
  • You must have a coherent picture. Since it is the holiday season, you could have a festive theme for your picture.
  • You must use multiple types of graphic functions (e.g. circles, rectangles, lines, etc.)
  • You must use a while or for loop to create a repeating pattern. Do not just redraw the same thing in the same location 10 times. Actually use that index variable as an offset to displace what you are drawing. Remember that you can contain multiple drawing commands in a loop, so you can draw multiple train cars for example.

For a template program to modify, look at the following example programs:
ProgramArcadeGames.com/python_examples/f.php?file=pygame_base_template.py
ProgramArcadeGames.com/python_examples/f.php?file=simple_graphics_demo.py

Sample pictures:

lab_5_fig_2
lab_5_fig_3
lab_5_fig_4
lab_5_fig_5

Chp 5 Graphics Continued

We will try to finish Chp5 and graphics today. If you get lost, you can follow along with the lecture here:

http://programarcadegames.com/index.php?chapter=introduction_to_graphics&lang=en#section_5

Please hand in the lesson to the dropbox when done. You can go ahead and take the practice quiz as well:

http://programarcadegames.com/quiz/quiz.php?file=graphics&lang=en

Pygame, starting with Graphics

Today, we are officially starting pygame. You will need to run your programs using the command line as Wing IDE 101 seems to not close the window properly when running your pygame programs (you can also use Mac OSX force quit instead).

We will try to get to the end of section 5.9. In case you get lost, here is the link to the tutorial lecture:

http://programarcadegames.com/index.php?chapter=introduction_to_graphics&lang=en#section_5

As usual, please submit your file to the server when done.