xabina/main.adb
2023-10-15 12:56:21 -04:00

51 lines
2.7 KiB
Ada

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- 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.
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- Experimental minimal terminal rogue-like game in Ada programming language. I used to write a lot of Ada programs some time ago, then went in full C and assembly mode, and came
-- back to Ada, but realized that I keep my folders messy... Since it's bothersome to find my old Ada projects and share them here, I decided that the most easy thing to do is to
-- write a new program in Ada, a tiny game. Work in progress, it's messy and ugly for now...
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
with core, game, action, map, item, magic, ammunition, weapon, armour, plant, animal, monster, player;
function main return integer is
begin
------------------------------------------------------------------------------------------
action.bind ('q', action.game_exit'access);
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);
core.screen_delete;
core.screen_offset;
core.screen_hide_cursor;
map.generate;
------------------------------------------------------------------------------------------
loop
map.render;
player.render;
core.render_buffer;
action.scan;
action.list (character'pos (action.signal)).all;
exit when action.active = false;
end loop;
------------------------------------------------------------------------------------------
core.screen_show_cursor;
return 0;
end main;