xhads/source/item.adb

34 lines
1.3 KiB
Ada
Raw Normal View History

-- Copyright (c) 2024 - Ognjen 'xolatile' Milan Robovic
--
-- GNU General Public Licence (version 3 or later)
with core;
2024-02-15 21:03:09 -05:00
package body item is
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
procedure configure is
begin
2024-03-11 08:42:25 -04:00
core.echo (core.comment, "Configuring item components...");
--
for index in enumeration loop
declare folder : constant string := core.lowercase (slot'image (trait (index).kind));
file : constant string := core.lowercase (enumeration'image (index));
2024-02-16 05:52:11 -05:00
begin
2024-04-26 19:46:09 -04:00
sprite (index) := core.import_sprite ("./sprite/item/" & folder & "/" & file & ".png", 4, 6);
2024-02-16 05:52:11 -05:00
end;
2024-02-15 21:03:09 -05:00
end loop;
end configure;
------------------------------------------------------------------------------------------
procedure draw (index : in enumeration; state : in core.animation; x, y : in integer) is
2024-02-15 21:03:09 -05:00
begin
core.draw (sprite (index), x, y, state => core.animation'pos (state));
2024-02-15 21:03:09 -05:00
end draw;
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
end item;