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_width is mod 120;
|
||||||
type map_height is mod 40;
|
type map_height is mod 40;
|
||||||
|
|
||||||
type map_constant_type is new entity_constant_type with
|
type map_constant_type is new entity_constant_type with
|
||||||
record
|
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;
|
end record;
|
||||||
|
|
||||||
type map_constant_list is array (map_list) of map_constant_type;
|
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 := (
|
map_constant_data : constant map_constant_list := (
|
||||||
(ENTITY_MAP, "Stone Wall ", '#', COLOUR_GREY, EFFECT_BOLD, true),
|
(ENTITY_MAP, "Stone Wall ", '#', COLOUR_GREY, EFFECT_BOLD, true, 59),
|
||||||
(ENTITY_MAP, "Wooden Wall ", '#', COLOUR_YELLOW, EFFECT_NORMAL, true),
|
(ENTITY_MAP, "Wooden Wall ", '#', COLOUR_YELLOW, EFFECT_NORMAL, false, 23),
|
||||||
(ENTITY_MAP, "Stone Floor ", '.', COLOUR_GREY, EFFECT_BOLD, false),
|
(ENTITY_MAP, "Stone Floor ", '.', COLOUR_GREY, EFFECT_BOLD, true, 47),
|
||||||
(ENTITY_MAP, "Wooden Floor ", '.', COLOUR_YELLOW, EFFECT_NORMAL, false),
|
(ENTITY_MAP, "Wooden Floor ", '.', COLOUR_YELLOW, EFFECT_NORMAL, false, 11),
|
||||||
(ENTITY_MAP, "Water (shallow) ", '~', COLOUR_BLUE, EFFECT_NORMAL, false),
|
(ENTITY_MAP, "Water (shallow) ", '~', COLOUR_BLUE, EFFECT_NORMAL, false, 0),
|
||||||
(ENTITY_MAP, "Water (deep) ", '~', COLOUR_BLUE, EFFECT_BOLD, true),
|
(ENTITY_MAP, "Water (deep) ", '~', COLOUR_BLUE, EFFECT_BOLD, true, 0),
|
||||||
(ENTITY_MAP, "Swamp (shallow) ", '~', COLOUR_GREEN, EFFECT_NORMAL, false),
|
(ENTITY_MAP, "Swamp (shallow) ", '~', COLOUR_GREEN, EFFECT_NORMAL, false, 0),
|
||||||
(ENTITY_MAP, "Swamp (deep) ", '~', COLOUR_GREEN, EFFECT_BOLD, true)
|
(ENTITY_MAP, "Swamp (deep) ", '~', COLOUR_GREEN, EFFECT_BOLD, true, 0)
|
||||||
);
|
);
|
||||||
|
|
||||||
map_variable_data : map_variable_list;
|
map_variable_data : map_variable_list;
|
||||||
|
map_matrical_data : map_matrical_list;
|
||||||
|
|
||||||
------------------------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
@ -192,7 +208,7 @@ function xabina return integer is
|
|||||||
loop
|
loop
|
||||||
for x in map_width
|
for x in map_width
|
||||||
loop
|
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 loop;
|
end loop;
|
||||||
end generate_map;
|
end generate_map;
|
||||||
@ -206,9 +222,9 @@ function xabina return integer is
|
|||||||
loop
|
loop
|
||||||
for x in screen_width
|
for x in screen_width
|
||||||
loop
|
loop
|
||||||
symbol := map_constant_data (map_variable_data (map_height (y), map_width (x))).symbol;
|
symbol := map_constant_data (map_matrical_data (map_height (y), map_width (x)).map).symbol;
|
||||||
colour := map_constant_data (map_variable_data (map_height (y), map_width (x))).colour;
|
colour := map_constant_data (map_matrical_data (map_height (y), map_width (x)).map).colour;
|
||||||
effect := map_constant_data (map_variable_data (map_height (y), map_width (x))).effect;
|
effect := map_constant_data (map_matrical_data (map_height (y), map_width (x)).map).effect;
|
||||||
render_character (symbol, colour, effect, y, x);
|
render_character (symbol, colour, effect, y, x);
|
||||||
end loop;
|
end loop;
|
||||||
end loop;
|
end loop;
|
||||||
@ -764,13 +780,13 @@ begin
|
|||||||
------------------------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
loop
|
loop
|
||||||
exit when active = false;
|
|
||||||
signal := CANCEL;
|
signal := CANCEL;
|
||||||
render_map;
|
render_map;
|
||||||
render_player;
|
render_player;
|
||||||
render_screen;
|
render_screen;
|
||||||
get_immediate (signal);
|
get_immediate (signal);
|
||||||
action_list (character'pos (signal)).all;
|
action_list (character'pos (signal)).all;
|
||||||
|
exit when active = false;
|
||||||
end loop;
|
end loop;
|
||||||
|
|
||||||
------------------------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user