Реферат: Моделирование игровых программ
Form1.ShowPole;
r:=MessageDlg('Цель достигнута!'+ #13+
'Еще раз?', mtInformation, [mbYes, mbNo], 0);
if r = mrNo then Form1.Close;
Form1.NewGame;
end;
end;
procedure TForm1.FormMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
var
cx,cy:integer;
begin
cx:= Trunc(X / wc) + 1;
cy:= Trunc(Y / hc) +1;
Move(cx, cy);
end;
procedure TForm1.ShowPole;
var
Source, Dest: Trect;
sx, sy: integer;
i,j: integer;
begin
for i:=1 to W do
for j:=1 to H do
begin
sy:=((pole[i,j]-1) div W)*hc;
sx:=((pole[i,j]-1) mod W)*wc;
Source:=Bounds(sx,sy,wc,hc);
Dest:=Bounds((j-1)*wc,(i-1)*hc,wc,hc);