xabina/player.adb

46 lines
1.9 KiB
Ada
Raw Normal View History

2023-10-15 11:00:07 -04:00
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- 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:35:38 -04:00
with core;
2023-10-15 12:00:08 -04:00
2023-10-15 11:00:07 -04:00
package body player is
------------------------------------------------------------------------------------------
2023-10-15 12:35:38 -04:00
use type core.screen_width;
use type core.screen_height;
2023-10-15 11:00:07 -04:00
procedure render is
begin
2023-10-15 12:35:38 -04:00
core.render_character ('@', core.colour.cyan, core.effect.bold, core.screen_height (data.y), core.screen_width (data.x));
2023-10-15 11:00:07 -04:00
end render;
2023-10-15 12:15:04 -04:00
procedure move_up is
begin
player.data.y := player.data.y - 1;
end move_up;
procedure move_down is
begin
player.data.y := player.data.y + 1;
end move_down;
procedure move_left is
begin
player.data.x := player.data.x - 1;
end move_left;
procedure move_right is
begin
player.data.x := player.data.x + 1;
end move_right;
2023-10-15 12:00:08 -04:00
2023-10-15 11:00:07 -04:00
------------------------------------------------------------------------------------------
end player;