xabina/main.adb

52 lines
2.2 KiB
Ada
Raw Normal View History

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- Copyright (c) 2023 - Ognjen 'xolatile' Milan Robovic
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- Xabina is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either
-- version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
-- implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
2023-10-15 12:56:21 -04:00
with core, game, action, map, item, magic, ammunition, weapon, armour, plant, animal, monster, player;
function main return integer is
begin
------------------------------------------------------------------------------------------
2023-10-15 14:31:43 -04:00
action.bind ('Q', action.game_exit'access);
2023-10-15 12:00:08 -04:00
action.bind ('w', player.move_up'access);
action.bind ('s', player.move_down'access);
action.bind ('a', player.move_left'access);
action.bind ('d', player.move_right'access);
2023-10-15 12:35:38 -04:00
core.screen_delete;
core.screen_offset;
core.screen_hide_cursor;
2023-10-15 12:35:38 -04:00
map.generate;
2023-10-15 16:17:17 -04:00
item.generate;
2023-10-15 15:12:49 -04:00
weapon.create (weapon.iron_mace, 2, 2);
2023-10-15 15:08:24 -04:00
------------------------------------------------------------------------------------------
loop
2023-10-15 12:35:38 -04:00
map.render;
2023-10-15 15:08:24 -04:00
item.render;
2023-10-15 15:12:49 -04:00
weapon.render;
player.render;
2023-10-15 12:35:38 -04:00
core.render_buffer;
2023-10-15 12:56:21 -04:00
action.scan;
2023-10-15 11:00:07 -04:00
action.list (character'pos (action.signal)).all;
exit when action.active = false;
end loop;
------------------------------------------------------------------------------------------
2023-10-15 12:35:38 -04:00
core.screen_show_cursor;
return 0;
end main;