mbLeft) then.click (g.toGameX (x, y), g.toGameY (x, y));; TmainForm . FormPaint (Sender: TObject);. Draw ();; TmainForm. FormResize (Sender: TObject);: = GameManager.OFFSET_X + GameManager.FIELD_SIZE * 10 + GameManager.OFFSET_X;: = GameManager.OFFSET_Y + GameManager.FIELD_SIZE * 12 + GameManager.OFFSET_Y;;. GameBall; Graphics; = class: TColor;
x, y, r: integer;, oy, fs: integer;
small: boolean; create (c: TColor; x, y, r: integer); overload; draw (canvas: TCanvas);;
{BALL} Ball.create (c: TColor; x, y, r: integer);: = c;. x: = x;. y: = y;. r: = r; ; Ball.draw (canvas: TCanvas); oldPen: TColor;: TColor;, worldY: integer;: = canvas. Pen. Color;: = canvas. Brush. Color;. Pen. Color: = clBlack;. Brush. Color: = color;: = oy + fs * (y +1);: = ox + fs * x;. Ellipse (worldX-r, worldY-r, worldX + r, worldY + r);. Pen. Color: = oldPen;. Brush. Color: = oldBrush;;. GameGrid; Graphics, gameBall; = class, sizeY: integer;: array of array of Ball;
canvas: TCanvas;, selIndexY: integer;
score: integer;: integer; doMove (m, n, m2, n2: integer); create (canvas: TCanvas; sx, sy: integer); overload; destroy (); overload; draw ();
procedure doSelect (m, n: integer);
function canMoveHere (m, n: integer): boolean; tick (); clear (); checkFigure (); existPath (m, n, m2, n2: integer): boolean;; p>
{GRID} Grid.create (canvas: TCanvas; sx, sy: integer); i: integer;. canvas: = canvas;: = sx;: = sy;: = -1;: = -1; (balls, sizeX); i: = 0 to sizeX-1 do (balls [i], sizeY);; Grid.destroy (); i: integer; i: = 0 to sizeX-1 do (balls [i], 0); (balls, 0);; Grid.draw (); i, j: integer; i: = 0 to sizeX-1 doj: = 0 to sizeY-1 do (balls [i, j] <> nil) then [i, j]. draw (canvas);; Grid.doSelect (m, n: integer);: = m;: = n;; Grid.doMove (m, n, m2, n2 : integer);; Grid.canMoveHere (m, n: integer): boolean;: = false;; Grid.tick ();; Grid.clear ();; Grid.checkFigure ();; Grid.existPath (m, n, m2, n2: integer): boolean;: = false;;. Ball; Graphics; = class: TColor;, y, r: integer;: boolean; create (c: TColor; x, y, r: integer) ; overload; draw (canvas: TCanvas);;
{BALL} Ball.create (c: TColor; x, y, r: integer);: = c;. x: = x;. y: = y;. r: = r; ; Ball.draw (canvas: TCanvas); oldPen: TColor;: TColor;: = canvas. Pen. Color;: = canvas. Brush. Color;. Pen. Color: = clBlack;. Brush. Color: = color;. Ellipse (x-r, y-r, x + r, y + r);. Pen. Color: = oldPen;. Brush. Color: = oldBrush;; Ball; Graphics; = class: TColor;, y, r: integer;: boolean; create (c: TColor; x, y, r: integer); overload; draw (canvas: TCanvas);;
{BALL} Ball.create (c: TColor; x, y, r: integer);: = c;. x: = x;. y: = y;. r: = r; ; Ball.draw (canvas: TCanvas); oldPen: TColor;: TColor;: = canvas. Pen. Color;: = canvas. Brush. Color;. Pen. Color: =...