uses graph,crt,dos; label 1,2; var a,xs,ys,i,xm,ym,xm1,ym1,helmeteor,helmeteor1,xm2,ym2,helmeteor2: integer; ch:char; s:string; ochki,foc:longint; f:text; gd,gm,snar,snary,prikol:integer; xmeteor:array [1..100] of word; xsnar:array [1..100] of word; ysnar:array [1..100] of word; z:byte; procedure zakr; begin settextstyle(SansSerifFont,horizdir,1); setcolor(11); outtextxy(getmaxx-200,getmaxy-20,'WWW.ZUY@.com.zad');  { setfillstyle(1,0); bar(getmaxx-100,getmaxy-50,getmaxx,getmaxy);} end; function inttostr(int: longint): string; var s: string; begin str(int:10,s); inttostr:=s; end; function step10(gown:byte) : longint; var govn,givn:byte; begin givn:=1; for govn:=1 to gown do givn:=givn*10; step10:=givn; end; procedure pusk; var abc:longint; begin for abc:=1 to 440 do begin setcolor(random(16)+1); circle(getmaxx div 2,getmaxy div 2,abc); delay(1000); setcolor(0); circle(getmaxx div 2-1,getmaxy div 2,abc); circle(getmaxx div 2,getmaxy div 2,abc); end; helmeteor1:=0; helmeteor1:=0; helmeteor1:=0; ochki:=ochki+250; end; procedure closeall; var s:string; begin assign(f,'sthet.txt'); reset(f); while not eof(f) do Read(F,foc); if foc0 then goto 1; prikol:=3; randomize; cleardevice; z:=0; snar:=0; foc:=0; xs:=30;ys:=200; xm:=500; snar:=0; snary:=0; i:=0; ochki:=0; repeat zakr; if keypressed then begin ch:=readkey; case ord(ch) of 0: begin case ord(readkey) of 80:up; 72:down; 75:left; 77:right; end; end; 32:begin inc(snar); inc(snary); xsnar[snar]:=xs-5; ysnar[snary]:=ys; end; 27:closeall; 9: if prikol>-2 then begin prikol:=prikol-1; pusk; end; end; end; inc(i); if xs<21 then xs:=21; if xs>600 then xs:=601; if ys<0 then ys:=2; if ys>470 then ys:=470; ship(xs,ys); for a:=1 to snar do begin inc(xsnar[a]); inc(xsnar[a]); inc(xsnar[a]); setcolor(2); circle(xsnar[a],ysnar[a],2); circle(xsnar[a],ysnar[a],1); if getpixel(xsnar[a]+3,ysnar[a])=darkgray then begin boom(xsnar[a],ysnar[a]); dec(snar); dec(snary); ochki:=ochki+random(50)+1; if abs(ysnar[a]-ym)<50 then dec(helmeteor) else if abs(ysnar[a]-ym1)<50 then dec(helmeteor1) else if abs(ysnar[a]-ym2)<50 then dec(helmeteor2) else pusk; if helmeteor=0 then begin boom(xm,ym); xm:=700; end; if helmeteor1=0 then begin boom(xm1,ym1); xm1:=700; end; if helmeteor2=0 then begin boom(xm2,ym2); xm2:=700; end; end; if xsnar[a]=640 then begin boom(xsnar[a],ysnar[a]); dec(snar); dec(snary); end; delay(200); setcolor(0); circle(xsnar[a],ysnar[a],2); circle(xsnar[a],ysnar[a],1); end; if xm=0 then begin xm:=600; helmeteor:=3; ym:=random(480); end; if xm1=0 then begin xm1:=600; helmeteor1:=2; ym1:=random(480); end; if xm2=0 then begin xm2:=600; helmeteor2:=1; ym2:=random(480); end; meteor(xm,ym); meteor(xm1,ym1); meteor(xm2,ym2); dec(xm); dec(xm1); dec(xm2); if (getpixel(xs+1,ys)=8) or (getpixel(xs,ys-6)=8) or (getpixel(xs,ys+6)=8) then begin setcolor(2); SetTextStyle(gothicFont, horizDir,8); outtextxy(getmaxx div 2-250,getmaxy div 2-100,'GAME OVER'); readln; closeall; end; setcolor(11); outtextxy(1,430,'prikol=');outtextxy(41,430,inttostr(prikol)); until 'zuy'='p*d*r'; closegraph; end.