Сделано всё схематично.Не судите строго,но вроде всё работает). uses Graph,CRt;
Label m1,m2;
const e=1.1;
var Device,Mode:Integer;
torpeda,korabli,E_y,a,b,k,n:Integer;
imya:String;
klavisha:Char;
T,dx,E_x:Real;
procedure Nachalo;
Begin
torpeda:=0;
korabli:=0;
SetColor(red);
WriteLn('Enter your name please');
readln(imya);
end;
procedure Music_Good;
Begin
Sound(200);Delay(1000);
Sound(400);Delay(1000);
Sound(600);Delay(1000);
Nosound;
end;
procedure Music_Bad;
Begin
Sound(600);Delay(1000);
Sound(400);Delay(1000);
Sound(200);Delay(1000);
Nosound;
end;
procedure PuCyHok;
Begin
writeln('Good luck',' ',imya,'!');
Writeln('BbinyweHHbix torneg',' ',torpeda);
Writeln('Nod6uTbIx kopa6leu',' ',korabli);
SetColor(blue);
SetFillStyle(1,Blue);
Rectangle(0,450,640,480);
FloodFill(100,460,blue);
SetColor(Red);
SetLineStyle(0,0,ThickWidth);
Line(320,450,320,430);
end;
procedure Ne_popal;forward;
procedure Popal;forward;
procedure ATAKA;forward;
procedure korabl;
label m1;
var sh_x,sh_y:Integer;
Begin
k:=0;
m1:
E_x:=0;
E_y:=30;
repeat
SetLineStyle(0,0,NormWidth);
SetColor(White);
Ellipse(Round(E_x),E_y,0,360,a,b);
Delay(4000);
SetColor(Black);
Ellipse(Round(E_x),E_y,0,360,a,b);
E_x:=E_x+dx;
if keypressed then begin
klavisha:=Readkey;
if klavisha='w' then begin ATAKA;
Break;
end;
end;
if E_x>=640 then begin
k:=k+1;
dx:=dx*e;
if k=7 then break;
goto m1;
end;
until E_x>=640;
end;
procedure ATAKA;
var Sh_x,Sh_y:Integer;
Begin
Sh_x:=320;
Sh_y:=420;
repeat
SetColor(Green);
Circle(Sh_x,Sh_y,10);
Delay(4000);
SetColor(Black);
Circle(Sh_x,Sh_y,10);
SetColor(White);
Ellipse(Round(E_x),E_y,0,360,a,b);
Delay(4000);
SetColor(Black);
Ellipse(Round(E_x),E_y,0,360,a,b);
if (Sh_x>=E_x-a) and (Sh_x<=E_x+a) and (Sh_y<=E_y+b) then Begin
Popal;
dx:=dx*e;
Break;
end;
E_x:=E_x+(dx*2);
Sh_y:=Sh_y-15;
if Sh_y<=2 then Ne_popal;
until Sh_y<=2;
end;
procedure Ne_popal;
Begin
dx:=dx*e;
Music_bad;
torpeda:=torpeda+1;
WriteLn('BbI npoma3alu,BbInyweHHbIx topneg',' ',torpeda);
end;
procedure Popal;
var d:Integer;
Begin
d:=15;
SetColor(Black);
Ellipse(Round(E_x),E_y,0,360,a,b);
repeat
SetLineStyle(0,0,ThickWidth);
SetColor(Yellow);
SetFillStyle(1,Yellow);
Circle(Round(E_x),E_y,d);
FloodFill(Round(E_x),E_y,Yellow);
Delay(40000);
SetColor(Black);
SetFillStyle(1,Black);
FloodFill(Round(E_x),E_y,Black);
d:=d+15;
until d>=45;
Music_Good;
korabli:=korabli+1;
torpeda:=torpeda+1;
Writeln('nog6uTbIx kopa6leu=',' ',korabli);
Writeln('BbInyweHHbIx topneg=',' ',torpeda);
end;
procedure KoHec;
Begin
if korabli<4 then WriteLn('Ma3ula!!!');
if (korabli>=4) and (korabli<=7) then WriteLn('CpegH94ok');
if korabli>=8 then WriteLn('npofeccuoHal!!!');
end;
procedure ypoBeHb;
Begin
WriteLn('BbI6epute ypoBeHb clojHocTu');
WriteLn('1-lerkuu,2-cpedHuu,3-clojHbIu');
klavisha:=ReadKey;
if klavisha='1' then begin
a:=50;
b:=30;
end;
if klavisha='2' then begin
a:=35;
b:=15;
end;
if klavisha='3' then begin
a:=25;
b:=10;
end;
end;
Begin
Device:=0;
InitGraph(Device, Mode, 'c:\tp7\BGI');
DirectVideo:=false;
m2:
n:=1;
dx:=2;
ypoBeHb;
Nachalo;
PuCyHok;
repeat
korabl;
n:=n+1;
dx:=dx*e;
until n=9;
KoHec;
WriteLn('6ydute lu urpaTb ewe?(Y/N)');
klavisha:=Readkey;
if klavisha='y' then goto m2
else halt;
ReadLn;
CloseGraph
end.