Homework #5

(15 points + 5 points extra credit)

 

For this homework, you can work in a team of 2 members maximum. Each team should turn in one program. Make sure that all of the team members' names are listed at the top of the program. If you are the one doing the turn in for the team, make sure that you know the access code of your partner.

You may also work alone if you wish.

Space Invasion!

When working at the computer, everyone needs to take a break once in a while. Since computer games are such a popular diversion, here is your chance to write your own computer game... Space Invasion! In this game, the player controls a space ship which shoots at aliens. The game is initially fairly simple, but you are free to make it as challenging as you like.

 

This homework is an extension of the graphics ideas you used in the homework assignments 1 and 2. In addition, it requires using inheritance and other issues involved in real-life programming:

  1. using a library of prepackaged functions
  2. having to make sense of  a fairly complicated program that someone else wrote

 

What you have to start with

Sample files: Alien.java, MovingObject.java, SpaceInvader.java, SpaceShip.java

The sample program displays an outer space screen with a space ship and some space aliens. The space ship moves back and forth on its own and it can shoot at the aliens if the player presses the space bar.

You have a sample executable program to experiment with (written in C). This sample executable only meets the basic requirements outlined below (it would receive a grade of 6/15).  In the sample executable, you can move the space ship to the left by hitting the "<" key and to the right by hitting the ">" key (actually, "," and "." work as well so you don't have to use the shift key). The ship will shoot if you press the space bar. Note that the sample executable has a menu. But this is not required in this assignment.

I will demonstrate the java version in class.

Start by reading through and running the sample file provided (Run the class SpaceInvader).  This program does a couple of things, but not many.  Make sure that you understand what it does before modifying it . 

What you need to end up with

To meet the basic requirements (worth 6 points), your program should

To do so, you will to complete some code in the three classes SpaceInvader, Alien and SpaceShip. Read through these classes. Comments in the code give you some ideas as to what to write.

Improve the program so that the game is fun to play. Beyond the above basic requirements, here are an extra requirement and some suggestions for a more exciting program (worth another 9 points).

Required (3 points)

Suggestions (4 of them or similar ideas = 6 points)

I am sure that you can come up with something interesting; you don't have to do something from this list if you have other ideas. But, you have to implement some features that go beyond the minimal requirements.

Caution:  Be realistic and don't try to do too much all at once.  It is much more important to have something fairly simple that works instead of something overly complex that you can't finish in time.  Start with a simplified version of your ultimate program, get that working, then add to it.

Grading

Your work will be graded on a 15 point scale. 6 points will be given to a program that meets the basic requirements.

The remaining 9 points are for the extra features that you need to add to the program. You will get the full 9 points if you create a new class for a new kind of Alien (= 3 points) and if you hear me yell "What a ride!" when I play your game (= 6 points). More precisely, if you implement at least 4 (non simplistic, glitzy and working) extra features, you have a very high probability of getting the full 6 points.

At the start of the file SpaceInvader.java, write a compliance statement describing how you think you meet the requirements of the assignment, e.g what are your 4 extra features and how is the new alien different? Full credit is given only if you have such a statement.

Extra-credit opportunity (up to 5 points)

Present in class the features that you added to your program to make the game more exciting. A clear presentation of some more advanced features will be rewarded with an additional 5 points.

Here are some examples of programs done by previous students: exe1, exe2, exe3, exe4

Good luck!  

Your program has to be your own.