CPE 471 Final Project

PongGL

Charlie Sibbach Dr. Wood





Overview
OpenGL was created to do real-time 3D rendering. One of the most notorious uses for this is games! This program is a new version of the original video game, taken literally to the next dimension.

Background
Pong is incorrectly called the first computer game. It isn’t even really the first video game. But it may as well be. Pong was one of the original games for the Magnavox Odyssey home game system, which was launched in 1972. Pong’s popularity was responsible for giving the fledgling video game industry a jump-start, and in this aspect, it can be called the Mother of All Games, a title a certain tank and ballistics game by the name of Scorched Earth later appropriated.

Motivation
The desire to make my own game is what started me with computers. It’s why I started learning C when I was 12. Making a game for my final project was really a no-brainer. I had more than an academic interest in learning OpenGL, which is why I took this class. PongGL provided a good chance to demonstrate what I know about OpenGL, and have some fun making a quick and dirty game with it. I chose Pong because the basic game idea is as simple as it gets, which means I had to spend less time on physics and more time on graphics. The graphics are still simple, relatively speaking, but make use of many more advance concepts such as smooth animation and collision detection.

Program Description
PongGL is a basic ball and paddle game, with the trick being it is played in three dimensions. Other than the opening demo scene, the human player is always the Blue paddle. One to five extra, computer-controlled paddles can be added to the game. The game is played in a cube. The ball reflects off both paddles and walls, with the caveat that it speeds up after reflecting of a paddle. As the maximum speed at which a paddle can move is limited, as the ball speeds up, it takes planning to be in the correct spot.
About a dozen viewpoints are available, with the basics being isometric views, straight axis views, and first-person views. In first-person mode, the camera’s position moves with your paddle, but it’s focus can be on other things. I added two other special features to make the game more graphically challenging. First is the “Pong Fog of War”, which is just what it sounds like- the ball will disappear into the haze, giving you less time to judge it’s position. The second is “Tron Walls” mode, which is actually the default. In this mode, the walls of the playing area only become visible when the ball is near them, which reminds me of certain effects in the computer animation breakthrough film “Tron”. Scoring of the game takes place in an inverse fashion because of the multiple players. Each player has a starting score, and when they miss the ball, a point is deducted. When their score hits 0, their paddle is deactivated and their wall becomes a normal wall.

Program Design
This is the programs strongest area I believe. The program design is very simple and direct, but bulletproof and expandable. There are 3 main classes that implement the Pong “engine”: PongBall, PongPaddle, and PongWorld. The main file never has to see or work with anything other than PongWorld. Other than those, I added CubeGL as a new primitive to my existing OpenGL class library. CubeGL is interesting in that it can be used by itself, or as a bounding object for a more complex shape such as a MeshGL. With that in mind, I built

User’s Guide
Controls:
Arrow Keys: Move your paddle. Note, the directions are fixed, so movement may be unintuitive with certain camera perspectives.
V and Space: switch between camera viewpoints
Right-Click menu: Set the game options, and start a new game.
Screen Shots









Sources
GLUT Basics Demo. Text display function was lifted from this code.
http://developer.apple.com/samplecode/Sample_Code/Graphics_3D/GLUT_Basics.htm

The history of Pong, used for this web page.
http://www.pong-story.com/intro