ITCC Homework 2
Due Monday, July 12 at 6:00am PST

DOWNLOAD the supplemental files.
REPLACE all previous framework files with the ones included in this package.

All assignments use the graphics framework. Look at the lecture slides on http://pclx.com/itcc for more information on how to complete these assignments. Use HW2's code and the slides as a guide. Our goal with these assignments is not to be strict or exact, but to allow each student to experiment and come up with his own solution to a rather flexible question.

PLEASE SUBMIT A SINGLE .cpp FILE TO [email protected] WITH YOUR SOLUTION WITH A COMMENT AS THE FIRST LINE OF YOUR FILE IDENTIFYING YOURSELF. PLEASE DO NOT RESUBMIT YOUR SOLUTION, EVEN IF IT IS INCORRECT THE FIRST TIME. THE SINGLE .cpp FILE SHOULD HAVE #2 and #3 WORKING CORRECTLY. YOU DO NOT HAVE TO WRITE ANSWERS TO THE QUESTIONS.


Challenge #1. We now have the skills to make a simple game! Try to make Pong. Pong is a game where you control a single "paddle" (line) on one side of the screen, and an opponent controls a second paddle on the opposite side of the screen. By moving the paddle left/right (or up/down if you play vertically), each player attempts to deflect a ball from their paddle in an attempt to make their opponent miss. The balls bounce from the edges of the screen (hint: use for or while loops to draw these edges and the paddles). A score is displayed based on how many balls the player has gotten their opponent to miss. For starters, make each paddle controllable by the keyboard for a two-player version. If you still want a challenge, read on!

More advanced programmers might want to implement advanced features, or start on a second simple game even! For instance, enemy AI could be added (see the rand() and srand() functions), the ball could be deflected at different angles and at different speeds (warning: may require trigonometry), a "catch" feature could be added where the ball becomes glued to the paddle and the player can launch it anywhere, paddle sizes could shrink every now and then to make gameplay more challenging, etc.

Most importantly, have fun with this one, as always :-)