38 lines
1.3 KiB
Ada
38 lines
1.3 KiB
Ada
with core, item;
|
|
|
|
use item;
|
|
|
|
package body item is
|
|
|
|
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
sprite : array (codex) of core.sprite;
|
|
|
|
------------------------------------------------------------------------------------------
|
|
|
|
procedure configure is
|
|
begin
|
|
core.echo (core.comment, "Configuring item components...");
|
|
--
|
|
for index in codex
|
|
loop
|
|
declare
|
|
folder : constant string := core.lowercase (slot'image (trait (index).kind));
|
|
file : constant string := core.lowercase (codex'image (index));
|
|
begin
|
|
sprite (index) := core.import_sprite ("./sprite/item/" & folder & "/" & file & ".png", 1, 1);
|
|
end;
|
|
end loop;
|
|
end configure;
|
|
|
|
------------------------------------------------------------------------------------------
|
|
|
|
procedure draw (index : in codex; x, y : in integer) is
|
|
begin
|
|
core.draw (sprite (index), x, y);
|
|
end draw;
|
|
|
|
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
end item;
|