Commiting again...
This commit is contained in:
parent
a70503303b
commit
ce4e496107
3
main.adb
3
main.adb
@ -26,8 +26,7 @@ begin
|
||||
|
||||
map.generate;
|
||||
item.generate;
|
||||
|
||||
weapon.create (weapon.iron_mace, 2, 2);
|
||||
weapon.generate;
|
||||
|
||||
------------------------------------------------------------------------------------------
|
||||
|
||||
|
32
weapon.adb
32
weapon.adb
@ -12,26 +12,32 @@ package body weapon is
|
||||
|
||||
------------------------------------------------------------------------------------------
|
||||
|
||||
procedure create (this : list;
|
||||
y : map.height;
|
||||
x : map.width) is
|
||||
procedure generate is
|
||||
y : natural := 0;
|
||||
x : natural := 0;
|
||||
identifier : natural := 0;
|
||||
begin
|
||||
map.variable_data (1) := (2, 2, core.weapon, list'pos (this));
|
||||
end create;
|
||||
for this in map.mark
|
||||
loop
|
||||
y := core.randomize (0, natural (map.height'last));
|
||||
x := core.randomize (0, natural (map.width'last));
|
||||
identifier := core.randomize (0, natural (list'size));
|
||||
map.variable_data (this) := (integer (y), integer (x), core.weapon, identifier);
|
||||
end loop;
|
||||
end generate;
|
||||
|
||||
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;
|
||||
for this in map.mark
|
||||
loop
|
||||
symbol := constant_data (list'val (map.variable_data (this).identifier)).symbol;
|
||||
colour := constant_data (list'val (map.variable_data (this).identifier)).colour;
|
||||
effect := constant_data (list'val (map.variable_data (this).identifier)).effect;
|
||||
core.render_character (symbol, colour, effect, core.screen_height (map.variable_data (this).y), core.screen_width (map.variable_data (this).x));
|
||||
end loop;
|
||||
end render;
|
||||
|
||||
------------------------------------------------------------------------------------------
|
||||
|
@ -74,10 +74,7 @@ package weapon is
|
||||
|
||||
------------------------------------------------------------------------------------------
|
||||
|
||||
procedure create (this : list;
|
||||
y : map.height;
|
||||
x : map.width);
|
||||
|
||||
procedure generate;
|
||||
procedure render;
|
||||
|
||||
------------------------------------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user