Comp 151 Project 5
Due: Mon Nov 7th at 11:55pm
Summary: You
will have the chance to practice functions and image
display in a graphics program.
Description
A
zip file of Sample Gifs
Here are some images that will work that have a very generous
license
You will need the Zelle graphics library for this one
- Pop up a window not less than 500x500 pixels (I used 700x700 for my
version)
-
- Make three functions
- the main function should take no parameters and return nothing it
should
- create a Graphwin
- call create_good_guy and pass the graphwin as an actual
parameter
- call create_bad_guys and pass the graphwin as an actual
parameter
- call move_stuff and pass the bad guy list that you get back from
create_bad_guys as its parameter.
- create_good_guy should take one formal parameter (a GraphWin) and
return the Zelle image object that you create in this function and
should:
- create an image object for the good guy.
- draw the good guy near the left edge of the screen.
- return the good guy object
- create_bad_guys should take one formal parameter (a GraphWin) and
return the Zelle image object that you create in this function and
should:
- create an initially empty list of bad guys.
- create 8 bad guys. for each bad guy
- create it at a different spot on the window so they don't
overlap, but make sure they are all in a vertical line
- draw the bad guy on the window
- add the badguy to the list to bad guys
- When everything is done, return the list of bad guys.
- move_stuff should
- loop forever
- move the bad guys up and down in a line, but don't let them
leave the screen.
Additional Requirements:
Your functions must contain all of your code
except the one line invoking the main function
To help me identify your work, make the name of your program file
yourFirstInitialLastNameLab5.py
(so mine would be JSantoreLab5.py)
Comment your code. include the usual
put the following at the beginning of the program as a comment:
- Your name
- anything that was left undone
- anything that I need to know to run the program correctly.
Submission:
zip the entire folder up again this time - there
will be images as well as python code.
Submit the zip file of the lab via blackboard as
usual. Don't forget to make sure your file has your name in the file name.