Comp 151 Project 6

lets work with loops, and graphics and collections and animation and ....

Due: Monday Nov 12th at 11:59pm (this is a holiday, so plan ahead and start early)


Summary: This project will help your practice more programming, particularly with lists and loops and graphics - so you'll see your results more quickly.


Description:

Write a zelle graphics library based python program which moved multiple images on the screen. When the first appear they should start out moving horizontally. If you click with the mouse on the window, another image should appear, also moving horizontally. If your user taps the spacebar then all of the pictures currently on the window should start moving perpendicularly to where they are going now (if a picture was moving horizontally, it needs to now move vertically; if it was moving vertically, it needs to now move horizontally.)
See my Implementation below

professor's implementation of project 6



To help you do this with what you know, I've created an addon to the Zelle Graphics library.

MovingPicture contains a zelle graphics style class that represents an image that knows its own dx and dy for movement.

create one just like you would a graphics.Image eg:

pict1 = MovingPicture.MovingPicture(graphics.Point(350, 350), "Smiley.png")

The Moving picture object has its own dx which starts out at 5 (so it is moving horizontally by default)

To change the picture's movement from horizontal to vertical you might do this:

 pict1.set_dy(5)
 pict1.set_dx(0)

To get the dx or dy you can use these functions:

current_dx = pict1.get_dx()
current_dy = pict1.get_dy()

Finally, since this moving picture knows its dx and dy, you can call move on it without anything in the parentheses

pict1.move() #will move pict1 by whatever its current dx and dy is


Submission:

Since you need to submit your whole folder this time, since I need your image file, - also include the other support files. be sure to zip up the entire project folder, remember to include your name in the name of the project so I don't end up with a dozen peoples work in one "Project 6" folder when I unzip everything.

Submit the lab via blackboard as usual. Don't forget to make sure your file has you name in the file name.