xhads/source/chad.adb

75 lines
3.0 KiB
Ada
Raw Normal View History

-- Copyright (c) 2024 - Ognjen 'xolatile' Milan Robovic
--
-- GNU General Public Licence (version 3 or later)
with core, ui, attribute, skill, resource, faction;
package body chad is
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
view_width : constant integer := 64;
view_height : constant integer := 96;
sprite : array (enumeration) of core.sprite;
view_sprite : array (enumeration) of core.sprite;
2024-04-23 16:19:29 -04:00
pepe_the_frog : core.sprite;
alice_the_mad : core.sprite;
2024-04-23 16:19:29 -04:00
------------------------------------------------------------------------------------------
procedure configure is
begin
2024-03-11 08:42:25 -04:00
core.echo (core.comment, "Configuring chad components...");
--
pepe_the_frog := core.import_sprite ("./sprite/unit/pepe_the_frog.png", 4, 6);
alice_the_mad := core.import_sprite ("./sprite/unit/alice_the_mad.png", 4, 6);
--
for index in enumeration loop
sprite (index) := core.import_sprite ("./sprite/chad/" & core.lowercase (enumeration'image (index)) & ".png", 4, 6);
view_sprite (index) := core.import_sprite ("./sprite/chad/view/" & core.lowercase (enumeration'image (index)) & ".png", 1, 1);
null;
end loop;
end configure;
------------------------------------------------------------------------------------------
procedure draw (index : in enumeration; x, y : in integer) is
begin
core.draw (sprite (index), x, y);
end draw;
------------------------------------------------------------------------------------------
procedure view (index : in enumeration; x, y : in integer) is
begin
ui.draw_sprite (view_sprite (index), trait (index).name, x, y, 0);
end view;
------------------------------------------------------------------------------------------
procedure draw_data (player : in data; x, y : in integer) is
begin
attribute.draw_points (player.attributes, x, y, true);
skill.draw_points (player.skills, x + core.icon * 3, y, true);
end draw_data;
------------------------------------------------------------------------------------------
procedure draw_pepe is
begin
core.draw (pepe_the_frog, (core.window_width - core.base) / 2, (core.window_height - core.base) / 2);
end draw_pepe;
------------------------------------------------------------------------------------------
procedure draw_alice is
begin
core.draw (alice_the_mad, (core.window_width - core.base) / 2, (core.window_height - core.base) / 2);
end draw_alice;
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
end chad;