Map reimplementation...
This commit is contained in:
parent
5e20a66b0f
commit
d808bfd58b
46
xabina.adb
46
xabina.adb
@ -158,31 +158,47 @@ function xabina return integer is
|
||||
|
||||
------------------------------------------------------------------------------------------
|
||||
|
||||
type map_mark is mod 72;
|
||||
type map_width is mod 120;
|
||||
type map_height is mod 40;
|
||||
|
||||
type map_constant_type is new entity_constant_type with
|
||||
record
|
||||
collide : boolean := false;
|
||||
collide : boolean := false;
|
||||
condition_limit : natural := 0;
|
||||
end record;
|
||||
|
||||
type map_variable_type is new entity_variable_type with
|
||||
record
|
||||
entity : entity_list := ENTITY_NULL;
|
||||
identifier : natural := 0;
|
||||
end record;
|
||||
|
||||
type map_matrical_type is
|
||||
record
|
||||
map : map_list := MAP_STONE_FLOOR;
|
||||
condition : natural := 0;
|
||||
end record;
|
||||
|
||||
type map_constant_list is array (map_list) of map_constant_type;
|
||||
type map_variable_list is array (map_height, map_width) of map_list;
|
||||
type map_variable_list is array (map_mark) of map_variable_type;
|
||||
type map_matrical_list is array (map_height, map_width) of map_matrical_type;
|
||||
|
||||
------------------------------------------------------------------------------------------
|
||||
|
||||
map_constant_data : constant map_constant_list := (
|
||||
(ENTITY_MAP, "Stone Wall ", '#', COLOUR_GREY, EFFECT_BOLD, true),
|
||||
(ENTITY_MAP, "Wooden Wall ", '#', COLOUR_YELLOW, EFFECT_NORMAL, true),
|
||||
(ENTITY_MAP, "Stone Floor ", '.', COLOUR_GREY, EFFECT_BOLD, false),
|
||||
(ENTITY_MAP, "Wooden Floor ", '.', COLOUR_YELLOW, EFFECT_NORMAL, false),
|
||||
(ENTITY_MAP, "Water (shallow) ", '~', COLOUR_BLUE, EFFECT_NORMAL, false),
|
||||
(ENTITY_MAP, "Water (deep) ", '~', COLOUR_BLUE, EFFECT_BOLD, true),
|
||||
(ENTITY_MAP, "Swamp (shallow) ", '~', COLOUR_GREEN, EFFECT_NORMAL, false),
|
||||
(ENTITY_MAP, "Swamp (deep) ", '~', COLOUR_GREEN, EFFECT_BOLD, true)
|
||||
(ENTITY_MAP, "Stone Wall ", '#', COLOUR_GREY, EFFECT_BOLD, true, 59),
|
||||
(ENTITY_MAP, "Wooden Wall ", '#', COLOUR_YELLOW, EFFECT_NORMAL, false, 23),
|
||||
(ENTITY_MAP, "Stone Floor ", '.', COLOUR_GREY, EFFECT_BOLD, true, 47),
|
||||
(ENTITY_MAP, "Wooden Floor ", '.', COLOUR_YELLOW, EFFECT_NORMAL, false, 11),
|
||||
(ENTITY_MAP, "Water (shallow) ", '~', COLOUR_BLUE, EFFECT_NORMAL, false, 0),
|
||||
(ENTITY_MAP, "Water (deep) ", '~', COLOUR_BLUE, EFFECT_BOLD, true, 0),
|
||||
(ENTITY_MAP, "Swamp (shallow) ", '~', COLOUR_GREEN, EFFECT_NORMAL, false, 0),
|
||||
(ENTITY_MAP, "Swamp (deep) ", '~', COLOUR_GREEN, EFFECT_BOLD, true, 0)
|
||||
);
|
||||
|
||||
map_variable_data : map_variable_list;
|
||||
map_matrical_data : map_matrical_list;
|
||||
|
||||
------------------------------------------------------------------------------------------
|
||||
|
||||
@ -192,7 +208,7 @@ function xabina return integer is
|
||||
loop
|
||||
for x in map_width
|
||||
loop
|
||||
map_variable_data (y, x) := MAP_STONE_FLOOR;
|
||||
map_matrical_data (y, x) := (MAP_WOODEN_FLOOR, map_constant_data (MAP_WOODEN_FLOOR).condition_limit);
|
||||
end loop;
|
||||
end loop;
|
||||
end generate_map;
|
||||
@ -206,9 +222,9 @@ function xabina return integer is
|
||||
loop
|
||||
for x in screen_width
|
||||
loop
|
||||
symbol := map_constant_data (map_variable_data (map_height (y), map_width (x))).symbol;
|
||||
colour := map_constant_data (map_variable_data (map_height (y), map_width (x))).colour;
|
||||
effect := map_constant_data (map_variable_data (map_height (y), map_width (x))).effect;
|
||||
symbol := map_constant_data (map_matrical_data (map_height (y), map_width (x)).map).symbol;
|
||||
colour := map_constant_data (map_matrical_data (map_height (y), map_width (x)).map).colour;
|
||||
effect := map_constant_data (map_matrical_data (map_height (y), map_width (x)).map).effect;
|
||||
render_character (symbol, colour, effect, y, x);
|
||||
end loop;
|
||||
end loop;
|
||||
@ -764,13 +780,13 @@ begin
|
||||
------------------------------------------------------------------------------------------
|
||||
|
||||
loop
|
||||
exit when active = false;
|
||||
signal := CANCEL;
|
||||
render_map;
|
||||
render_player;
|
||||
render_screen;
|
||||
get_immediate (signal);
|
||||
action_list (character'pos (signal)).all;
|
||||
exit when active = false;
|
||||
end loop;
|
||||
|
||||
------------------------------------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user