2024-02-22 03:29:04 -05:00
|
|
|
with core, effect, resource, faction, construction;
|
2024-02-15 21:03:09 -05:00
|
|
|
|
|
|
|
use construction;
|
|
|
|
|
|
|
|
package body construction is
|
|
|
|
|
|
|
|
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
type sprite_array is array (codex) of core.sprite;
|
|
|
|
|
|
|
|
------------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
sprite : sprite_array;
|
|
|
|
|
|
|
|
------------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
procedure configure is
|
|
|
|
begin
|
2024-03-11 08:42:25 -04:00
|
|
|
core.echo (core.comment, "Configuring construction components...");
|
|
|
|
--
|
2024-02-15 21:03:09 -05:00
|
|
|
for index in codex
|
|
|
|
loop
|
|
|
|
declare
|
|
|
|
folder : constant string := core.lowercase (faction.codex'image (trait (index).kind));
|
|
|
|
file : constant string := core.lowercase (codex'image (index));
|
|
|
|
begin
|
2024-03-17 16:45:46 -04:00
|
|
|
sprite (index) := core.import_sprite ("./sprite/construction/" & folder & "/" & file & ".png", trait (index).frames, 1);
|
2024-02-15 21:03:09 -05:00
|
|
|
end;
|
|
|
|
end loop;
|
|
|
|
end configure;
|
|
|
|
|
|
|
|
------------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
procedure draw (index : in codex; x, y : in integer) is
|
|
|
|
begin
|
|
|
|
core.move (sprite (index), x, y, trait (index).frames, 1);
|
|
|
|
end draw;
|
|
|
|
|
|
|
|
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
end construction;
|