Pinball Simulation

Mark Zablan
mzablan
Winter 2011

A pinball simulation

Important Links

Click here to view the technical write-up page.

Click here to download the source code.

Click here to download the final project executable.

Click here for a short video of the game in action.


Description

This project will be a computer graphics simulation of a pinball machine. Balls are launched upwards into a playing field through a plunger and then maneuver through a playing field until the player loses.

The simulation will at the very least involve work regarding collisions with walls and other static obstacles filling the playing field, much like the older-style of pinball machines but with flippers. Original pinball machines did not actually possess the flippers until later.


Goals

There are several goals for this project to get minimum functionalty present in a pinball machine.

The balls should be launched into the playing field through the simulation of a plunger.

It will be necessary to simulate the collisions of the ball with various objects on the playfield. There should be some uniform behavior when the ball collides with other more static obstacles and the walls of the playing field, for simplicity's sake it is assumed collisions are inelastic with little or no friction.

Lastly, the flippers should be able to work in a rough fashion when colliding with the walls in motion.


Directions

'Z' and '/' keys to trigger the left and right flippers respectively.

Space bar to launch the ball at the start.

'Q' or 'ESC' to quit the program.


Short details

The program relied heavily on several data structure classes, primarily a Vector_3d and Point_3d class which were easily extended to work in 2D.

Collisions were handled with vectors in a 2D plane assuming that the ball colliding with any stable object would result in no change of velocity in that object. See the technical report for more details.


Note: In an effort to save energy from using a computer monitor, no matter how miniscule, this page is set against a black background.