Browse Source

Commiting...

master
Ognjen Milan Robovic 8 months ago
parent
commit
d323c8b59f
4 changed files with 91 additions and 3 deletions
  1. +39
    -0
      item.adb
  2. +4
    -2
      main.adb
  3. +39
    -0
      weapon.adb
  4. +9
    -1
      weapon.ads

+ 39
- 0
item.adb View File

@@ -0,0 +1,39 @@
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- 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.
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

with core, map;

package body item is

------------------------------------------------------------------------------------------

procedure create (this : list;
y : map.height;
x : map.width) is
begin
map.variable_data (0) := (1, 1, core.item, list'pos (this));
end create;

procedure render is
symbol : character := ' ';
colour : character := core.colour.white;
effect : character := core.effect.normal;
begin
symbol := constant_data (list'val (map.variable_data (0).identifier)).symbol;
colour := constant_data (list'val (map.variable_data (0).identifier)).colour;
effect := constant_data (list'val (map.variable_data (0).identifier)).effect;
core.render_character (symbol, colour, effect, core.screen_height (map.variable_data (0).y), core.screen_width (map.variable_data (0).x));
--~for this in mark
--~loop
--~core.render_character ('@', core.colour.cyan, core.effect.bold, core.screen_height (map.variable_data (0)), core.screen_width (map.variable_data (0)));
--~end loop;
end render;

------------------------------------------------------------------------------------------

end item;

+ 4
- 2
main.adb View File

@@ -26,14 +26,16 @@ begin

map.generate;

item.create (item.paperweight, 1, 1);
item.create (item.paperweight, 1, 1);
weapon.create (weapon.iron_mace, 2, 2);

------------------------------------------------------------------------------------------

loop
map.render;
player.render;
item.render;
weapon.render;
player.render;
core.render_buffer;
action.scan;
action.list (character'pos (action.signal)).all;


+ 39
- 0
weapon.adb View File

@@ -0,0 +1,39 @@
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- 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.
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

with core, map;

package body weapon is

------------------------------------------------------------------------------------------

procedure create (this : list;
y : map.height;
x : map.width) is
begin
map.variable_data (1) := (2, 2, core.weapon, list'pos (this));
end create;

procedure render is
symbol : character := ' ';
colour : character := core.colour.white;
effect : character := core.effect.normal;
begin
symbol := constant_data (list'val (map.variable_data (1).identifier)).symbol;
colour := constant_data (list'val (map.variable_data (1).identifier)).colour;
effect := constant_data (list'val (map.variable_data (1).identifier)).effect;
core.render_character (symbol, colour, effect, core.screen_height (map.variable_data (1).y), core.screen_width (map.variable_data (1).x));
--~for this in mark
--~loop
--~core.render_character ('@', core.colour.cyan, core.effect.bold, core.screen_height (map.variable_data (0)), core.screen_width (map.variable_data (0)));
--~end loop;
end render;

------------------------------------------------------------------------------------------

end weapon;

+ 9
- 1
weapon.ads View File

@@ -6,7 +6,7 @@
-- implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

with core;
with core, map;

package weapon is

@@ -74,4 +74,12 @@ package weapon is

------------------------------------------------------------------------------------------

procedure create (this : list;
y : map.height;
x : map.width);

procedure render;

------------------------------------------------------------------------------------------

end weapon;

Loading…
Cancel
Save