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):
A zip
file of Sample Gifsfor those of
you who want some sample images here are some from the Wesnoth
game with a very generous license.
Pop up a window not less than 900x900 pixels
Make multiple functions.
You need something you are defending. (in my example above I've used
the sailing ships)
there should be two of them
they should be somewhat near the center of the window.
you need some bad guys
they should come from a randomly chosen direction (use 8 equally
spaced spots around the window, top left, top middle, top right,
right middle and so on.
every 3 seconds new bug(s) should appear and being moving toward
the goal objects
every 10-12 seconds
one more bad guy object should appear when ever new bad guys
spawn.
for example at the three second mark one bad guy spawns in, at
the 18 second mark 2 bad guys spawn in and at the 30 second mark
3 bad guys spawn in. (you will still get bad guys at all of the
multiples of three seconds of course)
the bad guys should speed up
for example at the three second mark, the bad guy might move 2
pixels per move, at the 18 second mark 6 pixels/move and at the
30 second mark 9 pixels/move.
you must display the score somewhere on the window
If you click on the bad guy with the mouse, it should disappear and
your score should increase.
If a bad guy gets to the object you are defending, it should
disappear
if the bad guys get to both of the objects and the both disappear
report to the player that they have lost
stop the remaining bad guys motion
for example in my implementation, it looks like this:
## 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