public class PinballEngine
extends java.lang.Object
Controlling class that manages and executes an automated game of Pinball,
played between two instances of IPlayer. Each player codes a solution to
the game assuming that the home goal resides in the lower left corner of
the board, at the origin (coordinates: 0,0). In an actual game, one player's
goal will be located in the upper right corner of the board (coordinates:
BOARD_SIZE_SQUARES-1, BOARD_SIZE_SQUARES-1). This class will transpose
coordinates to account for that difference at runtime. Coding an IPlayer
does not require any consideration of which goal is assigned to which
player.
The execution order is as follows:
1. Pinballs are moved
2. onCollision() is called in ITower objects
3. extinguishDeadTowers() is called
4. onDetectBall() is called in ITower objects
5. onDetectBall() is called in IPlayer
6. startTurn() is called in IPlayer
7. extinguishChosenTowers() is called
8. Item(s) popped off queue
- Author:
- megliola, ergin, moore