{$I-,Q-,R-,S-} uses graph,crt,dos; label 1,2; var a,xs,ys,i,xm,ym,xm1,ym1,helmeteor,helmeteor1,xm2,ym2,helmeteor2: integer; ch,key: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'); end; function inttostr(int: longint): string; var s: string; begin str(int:10,s); inttostr:=s; end; function step10(gown:byte) : longint; {stepen 10} 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+25; 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; ch:=' '; repeat zakr; key:=ch; if keypressed then {нажатие с клавы} begin key:=ch; ch:=readkey; 2: case ch of 's': up; 'w': down; 'a': left; 'd': right; ' ': begin if key ='s' then up else if key = 'w' then down else if key = 'a' then left else if key = 'd' then right; inc(snar); {увеличение масива по Х} inc(snary); {увеличение масива по Y} xsnar[snar]:=xs-5; ysnar[snary]:=ys; CH:=KEY; goto 2; 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) or (getpixel(xsnar[a]+2,ysnar[a]+1)=darkgray) or (getpixel(xsnar[a]+2,ysnar[a]-1)=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:=0; end; if helmeteor1=0 then begin boom(xm1,ym1); xm1:=0; end; if helmeteor2=0 then begin boom(xm2,ym2); xm2:=0; end; end; if xsnar[a]=640 then {если конец поля} begin boom(xsnar[a],ysnar[a]); dec(snar); dec(snary); end; delay(20);      setcolor(0);  circle(xsnar[a],ysnar[a],2); circle(xsnar[a],ysnar[a],1); end; if xm=0 then {проверка,если ХМ=0} begin boom(xm,ym); xm:=600; helmeteor:=3; ym:=random(480); end; if xm1=0 then begin boom(xm1,ym1); xm1:=600; helmeteor1:=2; ym1:=random(480); end; if xm2=0 then     begin boom(xm2,ym2); 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.