Comp 151 Project 6
Due: Thurs Nov 9th at
11:55pm(this leaves you the holiday weekend without an assignment)
Summary: You
will have the chance to practice functions and image display in a
graphics program.
Description
A
zip file of Sample Gifs for those
of you who want some sample images here are some from the Wesnoth
game with a very generous license.
You will need the Zelle graphics library for this one
Your final output will look something like this:
- Pop up a window not less than 500x500 pixels
-
- 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 bottom 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 10 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 horizontal 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 back and forth across the screen without
letting them overlap each other or go off the screen.
- move the good-guy back and forth using keyboard movment
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.