2024-04-25 00:27:13 -04:00
|
|
|
-- Copyright (c) 2024 - Ognjen 'xolatile' Milan Robovic
|
|
|
|
--
|
|
|
|
-- GNU General Public Licence (version 3 or later)
|
|
|
|
|
2024-04-26 18:25:29 -04:00
|
|
|
with core, item, unit, construction;
|
2024-02-15 21:03:09 -05:00
|
|
|
|
|
|
|
package world is
|
|
|
|
|
|
|
|
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
2024-04-26 19:46:09 -04:00
|
|
|
type biome is (
|
2024-04-27 09:04:47 -04:00
|
|
|
ash, sand, grass, rough, snow, swamp
|
2024-02-15 21:03:09 -05:00
|
|
|
);
|
|
|
|
|
|
|
|
------------------------------------------------------------------------------------------
|
|
|
|
|
2024-05-03 05:28:44 -04:00
|
|
|
type landmark_index is (
|
|
|
|
dead_tree, mossy_rock, palm_tree, pine_tree, reeds, rock, snowed_pine_tree, snowed_rock, spiky_rock
|
|
|
|
);
|
|
|
|
|
|
|
|
type landmark_trait is record
|
|
|
|
spawn : biome;
|
|
|
|
clip : boolean;
|
|
|
|
frames : integer;
|
|
|
|
end record;
|
|
|
|
|
|
|
|
type landmark_value is record
|
|
|
|
index : landmark_index;
|
|
|
|
x, y : integer;
|
|
|
|
end record;
|
|
|
|
|
|
|
|
type tile_array is array (natural range <>, natural range <>) of integer;
|
|
|
|
type landmark_array is array (natural range <>) of landmark_value;
|
|
|
|
|
|
|
|
type information is record
|
|
|
|
kind : biome;
|
|
|
|
width : natural;
|
|
|
|
height : natural;
|
|
|
|
tiles : access tile_array;
|
|
|
|
landmarks : access landmark_array;
|
|
|
|
end record;
|
|
|
|
|
|
|
|
------------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
tiles : core.sprite;
|
|
|
|
landmarks : array (landmark_index) of core.sprite;
|
|
|
|
|
|
|
|
landmark_limit : constant integer := 120;
|
|
|
|
|
|
|
|
trait : constant array (landmark_index) of landmark_trait := (
|
|
|
|
dead_tree => (ash, true, 1),
|
|
|
|
mossy_rock => (swamp, true, 1),
|
|
|
|
palm_tree => (sand, true, 4),
|
|
|
|
pine_tree => (grass, true, 4),
|
|
|
|
reeds => (swamp, false, 4),
|
|
|
|
rock => (sand, true, 1),
|
|
|
|
snowed_pine_tree => (snow, true, 4),
|
|
|
|
snowed_rock => (snow, true, 1),
|
|
|
|
spiky_rock => (ash, true, 1)
|
|
|
|
);
|
|
|
|
|
|
|
|
map : information;
|
|
|
|
|
|
|
|
------------------------------------------------------------------------------------------
|
|
|
|
|
2024-02-15 21:03:09 -05:00
|
|
|
procedure configure;
|
|
|
|
|
2024-04-26 19:46:09 -04:00
|
|
|
procedure make (index : in biome; width, height : in natural);
|
2024-02-15 21:03:09 -05:00
|
|
|
|
2024-04-27 03:49:02 -04:00
|
|
|
procedure draw;
|
2024-02-15 21:03:09 -05:00
|
|
|
|
|
|
|
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
end world;
|