diff --git a/source/main.adb b/source/main.adb index 23cb674..809c1b8 100644 --- a/source/main.adb +++ b/source/main.adb @@ -23,10 +23,8 @@ procedure main is map_preview_panel, status_preview_panel, text_box_panel ); - view_icon : array (view) of core.sprite; - - view_list : array (view) of boolean := (others => true); - + view_icon : array (view) of core.sprite := (others => (others => 0)); + view_list : array (view) of boolean := (others => true); view_text : array (view) of core.long_string := ( "Toggle map preview panel. ", "Toggle status preview panel. ", @@ -48,6 +46,7 @@ procedure main is procedure move_camera_up is begin core.move_camera_up; + core.camera.y := core.clip (core.camera.y, 0, world.map.height - 1); if world.map.clips (core.camera.x, core.camera.y) then core.increment (core.camera.y); end if; @@ -56,6 +55,7 @@ procedure main is procedure move_camera_down is begin core.move_camera_down; + core.camera.y := core.clip (core.camera.y, 0, world.map.height - 1); if world.map.clips (core.camera.x, core.camera.y) then core.decrement (core.camera.y); end if; @@ -64,6 +64,7 @@ procedure main is procedure move_camera_left is begin core.move_camera_left; + core.camera.x := core.clip (core.camera.x, 0, world.map.width - 1); if world.map.clips (core.camera.x, core.camera.y) then core.increment (core.camera.x); end if; @@ -72,6 +73,7 @@ procedure main is procedure move_camera_right is begin core.move_camera_right; + core.camera.x := core.clip (core.camera.x, 0, world.map.width - 1); if world.map.clips (core.camera.x, core.camera.y) then core.decrement (core.camera.x); end if; @@ -125,7 +127,7 @@ begin world.configure; ai.configure; - world.make (world.grass, 140, 120); + world.make (world.swamp, 120, 60); core.dash; core.echo (core.success, "Successfully initialized game data, entering main gameplay loop."); @@ -137,7 +139,7 @@ begin ui.active := ui.imp; - core.camera := (55, 50); + core.camera := (1, 1); ------------------------------------------------------------------------------------------ @@ -156,9 +158,6 @@ begin preview_height := core.window_height - text_box_height; text_box_height := 32; -- - core.camera.x := core.clip (core.camera.x, 0, world.map.width - 1); - core.camera.y := core.clip (core.camera.y, 0, world.map.height - 1); - -- world.draw; -- if view_list (map_preview_panel) then diff --git a/source/ui.adb b/source/ui.adb index 0ad3ca6..e0a6ff3 100644 --- a/source/ui.adb +++ b/source/ui.adb @@ -153,14 +153,14 @@ package body ui is ------------------------------------------------------------------------------------------ procedure draw_structure (data : in structure) is - offset : constant integer := core.icon; + offset : constant integer := core.icon / 4; new_width : constant integer := (if data.resize then 320 else data.width); - new_height : constant integer := (if data.resize then data.gui_n * (3 * core.icon / 2) + 2 * offset else data.height); + new_height : constant integer := (if data.resize then data.gui_n * (core.icon + 2 * offset) + 2 * core.icon else data.height); new_x : constant integer := (if data.center then (core.window_width - new_width) / 2 else data.x); new_y : constant integer := (if data.center then (core.window_height - new_height) / 2 else data.y); -- - at_x : integer := new_x + offset; - at_y : integer := new_y + offset; + at_x : integer := new_x + core.icon; + at_y : integer := new_y + core.icon; begin draw_tiny_menu (new_x, new_y, new_width, new_height); draw_title_bar (new_x, new_y, new_width, data.title); @@ -168,13 +168,13 @@ package body ui is for x in 0 .. data.gui_n - 1 loop case data.gui_list (x).kind is when gui_button => - draw_frame (data.gui_list (x).info, at_x, at_y, new_width - 2 * offset, 3 * core.icon / 2); - draw_icon (data.gui_list (x).image, data.gui_list (x).info, at_x + core.icon / 4, at_y + core.icon / 4); - write (data.gui_list (x).text, at_x + 5 * core.icon / 4, at_y + 2 + core.icon / 4); - if cursor_inside (at_x, at_y, new_width - 2 * offset - core.icon - 2, 3 * core.icon / 2) then - draw (cursor, at_x + new_width - 96, at_y); - end if; - at_y := at_y + 3 * core.icon / 2; + draw_frame (data.gui_list (x).info, at_x, at_y, new_width - 2 * core.icon, core.icon + 2 * offset); + draw_icon (data.gui_list (x).image, data.gui_list (x).info, at_x + offset, at_y + offset); + write (data.gui_list (x).text, at_x + core.icon + offset, at_y + offset + 2); + --~if cursor_inside (at_x, at_y, new_width - 2 * offset - core.icon - 2, 3 * core.icon / 2) then + --~draw (cursor, at_x + new_width - 96, at_y); + --~end if; + at_y := at_y + core.icon + 2 * offset; when others => null; end case; end loop; diff --git a/source/world.adb b/source/world.adb index 9054da0..cbf88ca 100644 --- a/source/world.adb +++ b/source/world.adb @@ -172,7 +172,7 @@ package body world is begin for x in 0 .. view_reach loop for y in 0 .. view_reach loop - map.views (x + core.camera.x - view_reach / 2, y + core.camera.y - view_reach / 2) := true; + map.views ((x + core.camera.x - view_reach / 2) mod map.width, (y + core.camera.y - view_reach / 2) mod map.height) := true; end loop; end loop; end view; diff --git a/sprite/attribute/defense.png b/sprite/attribute/defense.png index 310789a..a93970d 100644 Binary files a/sprite/attribute/defense.png and b/sprite/attribute/defense.png differ diff --git a/sprite/attribute/offense.png b/sprite/attribute/offense.png index 7c723d8..88144ed 100644 Binary files a/sprite/attribute/offense.png and b/sprite/attribute/offense.png differ diff --git a/sprite/attribute/reach.png b/sprite/attribute/reach.png index 0ac46b1..5a3b092 100644 Binary files a/sprite/attribute/reach.png and b/sprite/attribute/reach.png differ diff --git a/sprite/attribute/speed.png b/sprite/attribute/speed.png index 0375303..c252fbf 100644 Binary files a/sprite/attribute/speed.png and b/sprite/attribute/speed.png differ diff --git a/sprite/attribute/stamina.png b/sprite/attribute/stamina.png index 6e0db9c..0e9210b 100644 Binary files a/sprite/attribute/stamina.png and b/sprite/attribute/stamina.png differ diff --git a/sprite/attribute/wisdom.png b/sprite/attribute/wisdom.png index 48da4b2..dde7939 100644 Binary files a/sprite/attribute/wisdom.png and b/sprite/attribute/wisdom.png differ