Pool End Game
Chapter 3 of Ian Parberry's "Introduction to Game Physics with Box2D"
 All Classes Files Functions Variables Enumerations Pages
Pool End Game

This code was written by Ian Parberry to accompany his book "Introduction to Game Physics with Box2D", published by CRC Press in 2013.

This is the Pool End Game, a simple Windows application that uses DirectX 9 for rendering and hand-written code for the physics. The code uses ball-to-wall and ball-to-ball collision detection and response from Chapter 2. The aim is to sink the 8-ball while not sinking the cue-ball.

Use the up and down arrow keys to adjust the initial position of the cue-ball, the left and right arrow keys to adjust the cue-ball's direction (indicated by an arrow on the screen, and the space key to fire the ball. The space bar also restarts the game after you've sunk a ball. ESC exits the game.