;
DrawScreen;
DrawString (Base2, 124,80, 'Game Over');
WaitRetraceMode;
CopyBase (Base2, Base1);
Timer: = MemL [Seg0040: $ 006C];
for i: = 1 to 30 do
begin
While Timer = MemL [Seg0040: $ 006C] do;
Timer: = MemL [Seg0040: $ 006C];
end;
end;
{============================================== ====================}
Procedure Init;
begin
if not DetectVGA then
begin
Writeln ('Необхідний VGA сумісний відеоадаптер. '# 7);
Halt (1);
end;
SetGraphMode;
InitButtons;
Randomize;
ManX: = 19;
Timer: = MemL [Seg0040: $ 006C];
EnemyLimit: = (Level +1) * 20;
GetIntVec ($ 43, Pointer (Font));
end;
Procedure Game;
begin
InitEnemies;
Level: = 0;
Score: = 0;
Kills: = 0;
Combo: = 0;
EnemyLimit: = (Level +1) * 20;
GameOver: = false;
Repeat
ClearBase (Base2);
DrawScreen;
DrawEnemies;
DrawMan;
ComboString ('');
MoveEnemies;
CheckCollisions;
if Key [keyLeft] then if ManX> 0 then Dec (ManX);
if Key [keyRight] then if ManX <38 then Inc (ManX);
if Key [keySpace] then if StoneY = 0 then
begin
StoneX: = (ManX * 8) +4;
StoneY: = 24;
end;
WaitRetraceMode;
CopyBase (Base2, Base1);
While Timer = MemL [Seg0040: $ 006C] do;
Timer: = MemL [Seg0040: $ 006C];
Until Key [keyEsc] or (Level> = 10) or GameOver;
if GameOver then GameOverProc;
end;
Procedure Done;
begin
DoneButtons;
SetTextMode;
DoneVirtualPage;
end;
{============================================== ====================}
Var
choice: Byte;
begin
Init;
Repeat
choice: = Logo;
Case choice of
1: Game;
2: Info;
3: Story;
end;
Until choice = 4;
Done;
end.
UNIT Buttons;
INTERFACE
Uses DOS;
Const
keyESC = 1;
keyF1 = 59;
keyF2 = 60;
keyF3 = 61;
keyF4 = 62;
keyF5 = 63;
keyF6 = 64;
keyF7 = 65;
keyF8 = 66;
keyF9 = 67;
keyF10 = 68;
keyF11 = 87;
keyF12 = 88;
keyScrollLock = 70;
keyTilde = 41;
key1 = 2;
key2 = 3;
key3 = 4;
key4 = 5;
key5 = 6;
key6 = 7;
key7 = 8;
key8 = 9;
key9 = 10;
key0 = 11;
keyUnderline = 12;
keyEquality = 13;
keyBackspace = 14;
keyTab = 15;
keyQ = 16;
keyW = 17;
keyE = 1...