Last bug fixed, but code sucks...

This commit is contained in:
Ognjen Milan Robovic 2024-05-25 14:56:08 -04:00
parent ca93e3ad8e
commit cabd180dfb

View File

@ -131,6 +131,19 @@ package body world is
matrix (0, 1) := boolean'pos (map.tiles (lake_x + x - 1, lake_y + y) not in 18 .. 23); matrix (0, 1) := boolean'pos (map.tiles (lake_x + x - 1, lake_y + y) not in 18 .. 23);
matrix (1, 1) := boolean'pos (map.tiles (lake_x + x, lake_y + y) not in 18 .. 23); matrix (1, 1) := boolean'pos (map.tiles (lake_x + x, lake_y + y) not in 18 .. 23);
-- --
if map.tiles (lake_x + x, lake_y + y) not in 18 .. 23 and map.tiles (lake_x + x, lake_y + y + 1) in 18 .. 23 then
map.tiles (lake_x + x, lake_y + y) := 24;
end if;
if map.tiles (lake_x + x, lake_y + y) in 18 .. 23 and map.tiles (lake_x + x, lake_y + y + 1) not in 18 .. 23 then --
map.tiles (lake_x + x, lake_y + y + 1) := 25;
end if;
if map.tiles (lake_x + x, lake_y + y) not in 18 .. 23 and map.tiles (lake_x + x + 1, lake_y + y) in 18 .. 23 then
map.tiles (lake_x + x, lake_y + y) := 26;
end if;
if map.tiles (lake_x + x, lake_y + y) in 18 .. 23 and map.tiles (lake_x + x + 1, lake_y + y) not in 18 .. 23 then --
map.tiles (lake_x + x + 1, lake_y + y) := 27;
end if;
--
if matrix = ((1, 1), (1, 0)) then if matrix = ((1, 1), (1, 0)) then
map.tiles (lake_x + x - 1, lake_y + y - 1) := 28; map.tiles (lake_x + x - 1, lake_y + y - 1) := 28;
elsif matrix = ((1, 1), (0, 1)) then elsif matrix = ((1, 1), (0, 1)) then
@ -147,18 +160,6 @@ package body world is
map.tiles (lake_x + x - 1, lake_y + y) := 33; map.tiles (lake_x + x - 1, lake_y + y) := 33;
elsif matrix = ((1, 0), (0, 0)) then elsif matrix = ((1, 0), (0, 0)) then
map.tiles (lake_x + x - 1, lake_y + y - 1) := 35; map.tiles (lake_x + x - 1, lake_y + y - 1) := 35;
elsif map.tiles (lake_x + x, lake_y + y) not in 18 .. 23
and map.tiles (lake_x + x, lake_y + y + 1) in 18 .. 23 then
map.tiles (lake_x + x, lake_y + y) := 24;
elsif map.tiles (lake_x + x, lake_y + y) in 18 .. 23
and map.tiles (lake_x + x, lake_y + y + 1) not in 18 .. 23 then
map.tiles (lake_x + x, lake_y + y + 1) := 25;
elsif map.tiles (lake_x + x, lake_y + y) not in 18 .. 23
and map.tiles (lake_x + x + 1, lake_y + y) in 18 .. 23 then
map.tiles (lake_x + x, lake_y + y) := 26;
elsif map.tiles (lake_x + x, lake_y + y) in 18 .. 23
and map.tiles (lake_x + x + 1, lake_y + y) not in 18 .. 23 then
map.tiles (lake_x + x + 1, lake_y + y) := 27;
end if; end if;
end; end;
end loop; end loop;