Problem 1
Problem 2

Assignment 8

Goals: Learn to work with and test void methods; generate and traverse (musical) sequences of data, practice design and testing skills, have fun.


The names of the projects and some of the project files must be exactly the same as specified in the assignment. Failure to do so makes it impossible for the graders to run your submission and results in immediate loss of at least 50% of the homework credit.

Make sure you follow the style guidelines for code indentation.

You will submit this assignment by the deadline using the Web-CAT submission system.

With each homework you will also submit your log file named pairxxx.txt where you replace xxx with your pair number.

On top of every file you submit you will have the names of both partners, and the pair number.

The .txt file will be the log of your work on this assignment. Each log entry will have data and time, who was present (one or both of the partners) and a short comment decribing what you were working on.

Due Date - First Complete Working Version: Sunday, December 1, 10:00 pm, so we can prepare for the code review on Monday and Wednesday.

Due Date - Final Version: After the code review, hearing comments on your program, you will then have a chance to make additional changes and corrections, with the final version due on Wednesday, December 4th, 11:59 pm.

Problem 1

Design and implement an interactive game in the style of the FROGGER game or a MARIO game:


A frog or some other object is trying to cross several lanes of moving obstacles (e.g. cars) where each lane contains some number of obstacles, and some lanes move left, while other lanes move right (at least one of each). After successful crossing, the player (frog) has to cross a river (or other challenging area) withe other moving objects, some of which allow the player (frog) to hop on and move with the object (a log, or a lily pad), others may spell demise. The game score counts the number of successful crossings and starts with some limited number of lives.

MARIO game

Mario is running, leaping over obstacles (controlled by possibly space key), collecting some objects along the way. Game keeps score of the objects collected. Game ends when Mario fails to jump over an obstacle. Mario has several lives, i.e., the player can keep trying several times.

The game must be designed in imperative style. It should include a complete test suite.

In addition to submitting the code, you also need to provide a design document that would help a future designer to understand your game design and add new features and to modify your code. You also have to supply a user’s guide - that explains to the human player how the game is played (what are the controls, the goals, etc.)

Problem 2

Once you are done with the design and the game is working at least at a basic level, add sound effects. We want to make sure your game can be played in an identical way with and without the sound effects.

You should add sound effects to special events in the game - player moving, colliding, riding a lily pad, reaching the end, etc. You may also add a continuous loop of backgound music (e.g. like what is played during the final round of the Jeopardy game).

Submit this version separately from the original submission — here the testing is more difficult, and we will be more lenient in judging it.


During the lectures on Monday, November 25th, Monday, December 2nd, and Wednesday, December 4th we will have presentations of all games, with a review of the code for the games.

Note: Six brave pairs willing to have the code review on Monday, November 25th will get 10 extra credit points for the first part of their assignment. The game does not have to be complete by then, as long as there is an explanation in the code on how the programmers plan to do the rest. Submit this version on WebCAT by 10:00 pm on Sunday, November 24th. The additional benefit to these early submitters is from getting suggestions on how to improve their code a week before it is due.