Graphical Object Class

Our game will be structured around graphical objects, representing balls, cue ball, walls, and holes. Each type of graphical object will be held on a linked list of similar objects.

We will make use of routines and data types provided by Object Pascal whenever possible. One such data type is the class Rect, which declares a rectangular region of the playing surface. Every graphical object will have a region of the board in which it is displayed.

Every object knows how to initialize itself. Since Object Pascal does not have constructors this will be achived by means of a procedure we will call initialize. Every object knows how to draw itself, and every object will determine what it is to do when it is hit by a ball.

[audio] [real] Text to accompany slide4, in Chapter 6 of An Introduction to Object-Oriented Programming