Extended landmarks collision to be any size, aka landmark sprite dependent.

This commit is contained in:
Ognjen Milan Robovic 2024-05-06 14:35:19 -04:00
parent 7c8b9432a4
commit 58598f03c0
3 changed files with 15 additions and 6 deletions

View File

@ -53,12 +53,20 @@ package body world is
end loop;
--
for index in 1 .. landmark_limit loop
map.landmarks (index).index := core.random (0, 8);
map.landmarks (index).x := core.random (0, map.width - 1);
map.landmarks (index).y := core.random (0, map.height - 1);
map.landmarks (index).index := core.random (0, 9);
map.landmarks (index).x := core.random (6, map.width - 6);
map.landmarks (index).y := core.random (6, map.height - 6);
--
if trait (landmark_index'val (map.landmarks (index).index)).clip then
map.clips (map.landmarks (index).x, map.landmarks (index).y) := true;
declare reach_x : constant natural := landmarks (landmark_index'val (map.landmarks (index).index)).width / core.base;
reach_y : constant natural := landmarks (landmark_index'val (map.landmarks (index).index)).height / core.base;
begin
for x in 0 .. reach_x - 1 loop
for y in 0 .. reach_y - 1 loop
map.clips (map.landmarks (index).x + x, map.landmarks (index).y + y) := true;
end loop;
end loop;
end;
end if;
end loop;
--

View File

@ -15,8 +15,8 @@ package world is
------------------------------------------------------------------------------------------
type landmark_index is (
dead_tree, mossy_rock, palm_tree, pine_tree, reeds, rock,
snowed_pine_tree, snowed_rock, spiky_rock
dead_tree, mossy_rock, palm_tree, pine_tree, pine_forest, reeds,
rock, snowed_pine_tree, snowed_rock, spiky_rock
);
type landmark_trait is record
@ -59,6 +59,7 @@ package world is
mossy_rock => (swamp, true, 1),
palm_tree => (sand, true, 4),
pine_tree => (grass, true, 4),
pine_forest => (grass, true, 4),
reeds => (swamp, false, 4),
rock => (sand, true, 1),
snowed_pine_tree => (snow, true, 4),

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB