Homework Assignment 7
A Simple Game of Catch
CS 2530
Intermediate Computing
Due: Friday, October 26, at 5:00 PM
Introduction
Now that that we have seen
the Ball World
and
the Cannon Game,
and even
extended the Ball World,
let's write our own little world. It will be a small step toward
implementing classic video games like
Pong.
As primitive as Pong was, it was hugely popular!
Given the similarity of the new game world to the Cannon Game,
you might want to use the Cannon Game as an inspiration or
even a template for your solution.
Tasks
Create a simple game called Catch.
The window for a game of Catch looks something like this:
The game consists of a number of components:
- The black dot at the left is the pitcher. It launches
("throws") balls from a fixed location.
- The small rectangle at the right is the catcher. When
a ball strikes the catcher, the player has caught it.
- The slider at the left controls the velocity of the ball.
The higher the bubble is on the slider, the faster the
ball. The lower the bubble, the slower the ball.
- The slider on the right controls the position of the
catcher. The location of the catcher should roughly
match the location of the bubble.
- The button at the bottom throws a ball.
- The message at the top tells the player how many balls
have been thrown and caught.
The ball should bounce off the top and the bottom of the window,
but not the wall behind the catcher. If it bounces past the
catcher, it is out of play. (So, you should use a
BoundedBall, or a variation of it.)
Be sure that your submission has at least ...
- ... a class named CatchFrame that models
the above window and lets the user play the game.
- a class named Catch that contains nothing
but a main() method, which creates an
instance of CatchFrame and makes it
visible.
- ... a file named readme.txt that documents
briefly the major decisions you made while designing and
implementing the game.
Feel free to add your own style to the game -- as long as your
solution follows the guidelines above. Have as much fun as you
are willing and able!
Deliverables
By the due date and time, submit a zipped file containing:
- readme.txt
- Catch.java
- CathFrame.java
- any other files you create or use
For your hardcopy, submit only your readme.txt
file.
Be sure that your submission follows all
homework submission requirements.
Eugene Wallingford .....
wallingf@cs.uni.edu .....
October 19, 2012