. Дворак, В«ПергаментВ» - Санкт-Петербург, 1994. p> 11. Turbo Pascal 7. 0, Фаронов В.В. /Вид. В«НолиджВ», 1999. br/>
ДОДАТОК:
Program Siege;
Uses LogoScreen,
DOS, VGA13h, VGASpr, Retrace, Buttons,
SiegeLogo, SiegeS
pr;
Type
EnemyType = record
X, Y, D, S, A: Integer;
Falling: Boolean;
Free: Boolean;
end;
Const
MaxEnemies = 50;
ComboStr: Array [0 .. 5] of String [20] =
('Looser!', p> '', p> '2 Hit combo ',
'Eat this!', p> 'Ough! 4 mans at once ',
'Aaaaaaaaamazing!'); p> Var
ManX, StoneY, StoneX, EnemyDelay, EnemyLimit: Integer;
Enemies: Array [1 .. MaxEnemies] of EnemyType;
Score, Level, Kills, Combo: Word;
Timer: Longint;
GameOver: Boolean;
{============================================== ====================}
Const
ca: Word = 0;
cc: String [20] ='';
Procedure ComboString (s: String);
begin
if s <>'' then
begin
cc: = s;
ca: = 10;
end;
if ca> 0 then
begin
DrawString (Base2 ,160-Byte (cc [0]) * 4,90, cc);
Dec (ca);
end;
end;
Procedure NextLevel; forward;
{============================================== ====================}
Procedure InitEnemies;
Var
i: Byte;
begin
for i: = 1 to MaxEnemies do Enemies [i]. Free: = true;
end;
Procedure DrawEnemies;
Var
i: Byte;
begin
for i: = 1 to MaxEnemies do
With Enemies [i] do if not Free then
DrawTSpr (Base2, X, Y, EnemyHgt, EnemyWdt, @ EnemySpr [A]);
end;
Procedure MoveEnemies;
Var
i: Byte;
begin
for i: = 1 to MaxEnemies do
With Enemies [i] do
if not Free then
begin
if Falling then
begin
Y: = Y +10;
if Y> 199 then
begin
Free: = true;
if Kills = (Level +1) * 20 then NextLevel;
end;
if D = 0 then
begin
Inc (A);
if A> 2 then A: = 1;
D: = 2;
end else Dec (D);
end else
if D = 0 then
begin
Y: = Y-5;
if Y <40 then GameOver: = true;
Inc (A);
if A> 2 then A: = 1;
D: = S;
end else Dec (D);
end else
if (EnemyLimit> 0) and (EnemyDelay = 0) then
begin
X: = Random (38) * 8;
Y: = 200;
D: = 0;
S: = (10-Level);
A: = 1;
EnemyDelay: = (13-Level) * 2 +1;
Falling: = false;
Free: = false;
Dec (EnemyLimit);
end;
Dec (EnemyDelay);
end;...