Homework 2
CS 320
50 points, due Mar. 13, 1998
Using the pong starting point code I gave you, finish the program. Your
program should have the following features:
- Good coding and design:
- Modularity. Short functions.
- Symbolic constants. No hard-coded constants.
- Documentation: meaningful (to someone other than yourself)
identifier names and comment if necessary, a brief explanation for each
function, and an explanation of overall program features.
- A menu so that the player can increase the skill level, quit,
restart, and change the color of the ball(s).
- A skill-level which increases over time. Document how you modeled
this.
- Model the face of the paddle as a curved surface, penalizing with
increasing distance from the ``sweet spot'' and rewarding for hitting with
the sweet spot.
- An on-window non-flickering score.
- Use viewports for the game portion of the window and the scoreboard
portion of the window.
- Only clear the entire window or viewport when absolutely necessary.
E.g., blank the previous ball position rather than the entire viewport.
- Occasionally randomize the reflection off the paddle's sweet spot so
that the player can't simply maneuver the ball's trajectory in such a way
that they can leave the paddle motionless.
In addition, implement any two of the following:
- Use a wireframe representation for the ball and implement rotation.
Document how you modeled rotation.
- Use mouse motion (see the man page for
mousemotionfunc
) rather
than the arrow keys to control the paddle.
- Introduce multiple balls. Modeling off-center collisions will
require some thought.
- Use ``Breakout''-style bricks.
- Use
gluttimerfunc
so that your game runs at the same speed on
PCs of various speeds.
I am willing to consider other features with which to augment this list.
Your program is due at the beginning of class. Once again, place all files
in your class folder. No bribes this time. March 11 will be used
as an in-class lab day for the project. You should have the basic program
working by then.
Thomas P. Kelliher
Sun Mar 1 19:56:28 EST 1998
Tom Kelliher