Comp 151 Project 8: The last one


Due: Saturday May 11th� at 11:55pm(after the final for 12:20 class, before the final for the 1:50 class)

Summary: As your final project of the semester, you will get a chance to build a larger project that usual to give you experience building something closer to a Comp152 sized project.

Description

Once upon a time, long long ago Microsoft was 'the evil empire' that was trying to control all of your computing. In that time one of the most popular games on linux was a game called xbill. We are going to write a small one level game that emulates some of the gameplay of xbill. If you are unfamiliar with xbill, you can view and official play-through here (don't watch the whole thing, just skip past the middle 15 minutes)
You will need the Zelle graphics library for this one.

Your final output will look something like this (I've used a Nautical theme of giant bugs trying to eat my ships):

My sample implementation of project 5

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'll need to do an image overlap check in order to do this project.� I got this technique from the following site http://www.geeksforgeeks.org/find-two-rectangles-overlap/


## Returns true if two Zelle images overlap
def doOverlap(Pict1:graphics.Image, Pict2:graphics.Image):
#find the upper left and lower right of the first image
l1 = Pict1.getAnchor()
l1.move(-Pict1.getWidth()/2, -Pict1.getHeight()/2)
r1 = Pict1.getAnchor()
r1.move(Pict1.getWidth()/2, Pict1.getHeight()/2)
#get the upper left and lower right of Pict2
l2 = Pict2.getAnchor()
l2.move(-Pict2.getWidth() / 2, -Pict2.getHeight()/2)
r2 = Pict2.getAnchor()
r2.move(Pict2.getWidth() / 2, Pict2.getHeight()/2)
# If one rectangle is on left side of other
if l1.getX() > r2.getX() or l2.getX() > r1.getX():
return False
# If one rectangle is above other
if l1.getY() > r2.getY() or l2.getY() > r1.getY():
return False
return True # we could use else but not really needed


you can also use this modification of the function I gave you in project 5. Give it a graphics.Image and a graphic.Point (of the mouse click

def is_clicked(pict: graphics.Image, point: graphics.Point):
xloc = point.getX()
yloc = point.getY()
center = pict.getAnchor()
if xloc >= center.getX() - pict.getWidth() / 2 and xloc <= center.getX() + pict.getWidth() / 2 and \
yloc >= center.getY() - pict.getHeight() / 2 and yloc <= center.getY() + pict.getHeight() / 2:
return True
else:
return False

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 project folder

yourFirstInitialLastNameLab8

(so mine would be JSantoreLab5)�

Comment your code. include the usual
�put the following at the beginning of the program as a comment:

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 you name in the file name.