Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Скачиваний:
72
Добавлен:
10.12.2013
Размер:
3 Кб
Скачать
unit ArcUnit;
interface
 var Mouse:boolean;
 procedure Zastavka;
 procedure OutMenuStr(ns,CF: word);
 procedure RunMenu;
 procedure Menu;
 procedure Help;
implementation

uses graph, Crt, ArcUnitK;
const MaxNs = 2;
 procedure Zastavka;
 var drv,mode: Integer;
  begin
  drv:=vga;
mode:=2;
initgraph(drv,mode,'c:\progra~1\borland\tp\bgi');
setbkcolor(blue);
setcolor(red);
settextstyle(4,0,10);
outtextxy(95,100,'Arcanoid');
setcolor(white);
settextstyle(3,0,0);
outtextxy(150,250,'Esc - begin game');
outtextxy(150,285,'F1 - help');
outtextxy(150,310,'F2 - control');
   repeat ReadKey;
    if GetKey(kbEsc) or GetKey(13) then begin Break; Exit; end;
    if GetKey(60) then begin Menu; Break; end;
    if GetKey(59) then begin Help; Break; end;
   until KeyPressed;
closegraph;
end;

 {--------------------------}

procedure OutMenuStr(ns,CF: word);
 var im : word;
Begin
  GotoXY( 28,7); Write('‚лЎ®а гЇа ў«Ґ­Ёп');
  TextColor(white);TextBackGround(CF);
  case ns of
  1:begin GotoXY(20,10); for im:=1 to 30 do Write(' ');
          GotoXY(20,10); Write('1.“Їа ў«Ґ­ЁҐ б Є« ўЁ вгал.');
    end;
  2:begin GotoXY(20,11); for im:=1 to 30 do Write(' ');
          GotoXY(20,11); Write('2.“Їа ў«Ґ­ЁҐ ¬лимо.');
    end;
  end;
End;

procedure RunMenu;
var i : word;
 begin
  ClrScr; for i:=1 to MaxNs do OutMenuStr(i,0);
 end;
var ns : word;  Ch : char;

procedure Menu;
Begin
  closegraph;
  RunMenu; ns:=1;
  repeat
    if ns<>0 then OutMenuStr(ns,7);
    Ch:=ReadKey;
    if ns<>0 then OutMenuStr(ns,0);
    case Ch of
    #0:begin Ch:=ReadKey;
         case Ch of
         #72:if ns<>0 then if ns>1 then ns:=ns-1 else ns:=MaxNs;
         #80:if ns<>0 then if ns<MaxNs then ns:=ns+1 else ns:=1;
         end;
       end;
    #13:case ns of
        1:begin Mouse:=False; Break; Zastavka end;
        2:begin Mouse:=True; Break; Zastavka end;
        end;
    #27: begin Break; Zastavka end;
    end;
  until FALSE;
  TextBackGround(0); ClrScr; Zastavka
End;

procedure Help;
 begin
  closegraph;
  TextBackGround(blue);
  ClrScr;
  Textcolor(White);
  GotoXY( 35,2); Write('HELP');
  GotoXY( 25,7); Write(' “Їа ў«Ґ­ЁҐ б Є« ўЁ вгал: ');
  GotoXY( 25,9); Write('„Ґ©бвўЁҐ             Љ« ўЁи ');
  GotoXY( 25,10); Write('‚«Ґў®                a');
  GotoXY( 25,11); Write('‚Їа ў®               d');
  GotoXY( 25,14); Write('‚л室 ў® ўаҐ¬п ЁЈал  Esc');
  GotoXY( 30,20); Write('Press Enter to Exit');
  ReadLn; ClrScr; Zastavka;
 end;
end.
Соседние файлы в папке Arcanoid