Objects must be initialized

As we noted in the last slide, the language Object Pascal does not have constructors, and so we must write explicit initialization routines. This slide shows one example. A wall is initialized by giving its coordinates, and a conversion factor used in reflecting balls when they strike.

To set the region, we use a function, SetRect, provided by the Apple standard library. This function takes four corrdinate values and initializes a rectangle value.

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