Eliminated magic characters

master
mian 2 years ago
parent 5f2ecbabdf
commit fbcee326b2
  1. 36
      dataUnit.pas
  2. 6
      heroEnemy.pas
  3. 4
      moversProc.pas
  4. 4
      toolsProc.pas

@ -13,6 +13,17 @@ Const
empty = '.';
man = '&';
gem = '*';
wall = '#';
wallSlip = '@';
earth = 'H';
boulder = '0';
block = 'M';
magnetx = 'N';
magnety = 'Z';
turnerRight='a';
turnerLeft='c';
monster = '%';
walkable = [empty,earth,gem];
movers : array[TMoverType, TMoverDir] of char =
(
('^','>','v','<'),
@ -22,15 +33,14 @@ Const
gliders = ['^','>','v','<'];
walkers = ['u','r','d','l'];
pushers = ['U','R','D','L'];
UpMovers = ['u', 'U', '^'];
UpMovers = ['u', 'U', '^'];
DownMovers = ['d', 'D', 'v'];
LeftMovers = ['l', 'L', '<'];
RightMovers = ['r', 'R', '>'];
walkable = [empty,'H',gem];
magnets = ['N','Z'];
pushable = ['M','0','c','a']
magnets = [magnetx,magnety];
pushable = [block,boulder,turnerLeft,turnerRight]
+ magnets + gliders + walkers + pushers;
slipery = ['@','0',gem] + gliders;
slipery = [wallSlip,boulder,gem] + gliders;
enemies = ['%'];
@ -65,13 +75,13 @@ Begin
Case x of
'K': Exit(man);
' ': Exit(empty);
'5': Exit('#');
'1'..'4','6'..'9': Exit('@');
'e': Exit('H');
'b': Exit('M');
's': Exit('Z');
'~','E','C','[': Exit('%');
'B': Exit('0');
'5': Exit(wall);
'1'..'4','6'..'9': Exit(wallSlip);
'e': Exit(earth);
'b': Exit(block);
's': Exit(magnety);
'~','E','C','[': Exit(monster);
'B': Exit(boulder);
else Exit(x);
End;
End;
@ -115,7 +125,7 @@ Begin
readLevel.manRow := row;
readLevel.manCol := col;
End;
'%':
monster:
Begin
inc (readLevel.numEnemies);
readLevel.enemy[readLevel.numEnemies].col := col;

@ -27,8 +27,8 @@ Begin
(* Move man *)
If move Or (nextTile In walkable) Then
Begin
(* Colect diamonds while where at it *)
If nextTile = '*' Then
(* Colect gems while where at it *)
If nextTile = gem Then
dec(theGS.goal);
(* The moving *)
theGS.map[theGS.manRow, theGS.manCol] := empty;
@ -66,7 +66,7 @@ Begin
For tries := 4 Downto 1 Do
Begin
(* If there's an obstacle. *)
If theGS.map[row+rowstep, col+colstep] <> '.' Then
If theGS.map[row+rowstep, col+colstep] <> empty Then
Begin
If random(1) = 0 then
colstep := -colstep

@ -43,8 +43,8 @@ var
begin
(* I don't move if I'm cought by a magnet *)
If (rstep <> 0) and (g.map[row - rstep, col] = 'Z') then Exit;
If (cstep <> 0) and (g.map[row, col - cstep] = 'N') then Exit;
If (rstep <> 0) and (g.map[row - rstep, col] = magnety) then Exit;
If (cstep <> 0) and (g.map[row, col - cstep] = magnetx) then Exit;
(* I don't move beyond the map *)
if (col + cstep > g.mapWidth) or (col + cstep < 1) or

@ -31,8 +31,8 @@ Begin
For col := 1 To g.mapWidth Do
Begin
Case g.map[row,col] Of
'N': cstep := 1;
'Z': rstep := 1;
magnetx: cstep := 1;
magnety: rstep := 1;
Else continue;
End;
For i := 0 To 1 Do

Loading…
Cancel
Save