October 2001
Intermediate to advanced
640 pages
18h 58m
English
This appendix lists the complete source for the billiards simulation described in Chapter 7.
unit GraphicsEx;
(*
Billiards Simulation Program
Written by Tim Budd, July 2001 *) interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, ExtCtrls, StdCtrls; type TBall = class(TObject) public constructor create (ix, iy : Integer; iLink : TBall); procedure draw (canvas : TCanvas); function hasIntersected(aBall : Tball) : Boolean; procedure hitBy (aBall : TBall); procedure update; procedure setCenter (nx, ny : Integer); procedure setDirection (nd : Real); private x, y : Integer; direction : Real; energy : Real; ...Read now
Unlock full access