Comp101 Project 6:
Objects and Events

Due: April 14th at 11:59pm
Note that your have two weeks to do this lab. You will need more time than usual. Do not wait till the last minute to start.

Summary:

In This project you will be defining your own classes and handling events for the first time. You will create an object from an image. Have it respond to keyboard controls by moving.

example lab6

Details:

Create a pygame windowed program. Your program needs to have a class for your moving object (the rabbit in my project above.). The class should have at least the __init__ and update methods. You're class can either use your complex shape from lab5 for its picture or any (appropriate) image file that you might have. I suggest png format images since they will not have the "ugly rectangle around the image" issue. Your object needs to respond to the left right, up and down arrow keys moving in the appropriate direction when the keys are pressed. Your object should not move off of the screen, if the user tries to move off of the screen, simply stop the movement at the edge of the screen.

You also need a second non moving object (the egg in my version above). When the first object collides with the second object, your second object should dissappear.

Your program should end when the user closes the window.


Additional Requirements and Submission: