diff --git a/game/world/terrain/terrain.png b/game/world/terrain/earth.png similarity index 100% rename from game/world/terrain/terrain.png rename to game/world/terrain/earth.png diff --git a/game/world/terrain/water.png b/game/world/terrain/water.png new file mode 100644 index 0000000..8b6d377 Binary files /dev/null and b/game/world/terrain/water.png differ diff --git a/source/core.adb b/source/core.adb index 936f52d..63ef1fe 100644 --- a/source/core.adb +++ b/source/core.adb @@ -292,8 +292,8 @@ package body core is new_tint : ray.colour := (ray.colour_range (tint.r), ray.colour_range (tint.g), ray.colour_range (tint.b), ray.colour_range (tint.a)); begin ray.draw_texture (data => texture_array (data.index), - uv => (x => float (if u > 0 then u else (animation_time mod data.frames) * data.width), - y => float (animation'pos (state) * data.height), + uv => (x => float (if u > 0 then u else (animation_time mod data.frames) * data.width), + y => float (if v > 0 then v else (animation'pos (state) mod data.states) * data.height), width => new_width, height => new_height), view => (x => float (x), diff --git a/source/main.adb b/source/main.adb index ee80e89..de0979b 100644 --- a/source/main.adb +++ b/source/main.adb @@ -217,7 +217,7 @@ begin world.configure; --~ai.configure; - world.make (world.grass, 240, 180); + world.make (world.swamp, 240, 180); world.add_chad (player, (0, 0, 0)); @@ -314,11 +314,7 @@ begin view_show (index)); end loop; -- - resource.draw_points (player.resources, (preview_width - 4 * icon * resource.count) / 2, (if view_list (map_preview_panel) then icon else 0)); - ui.draw_fill_bar ((preview_width - 320) / 2, 4 * (if view_list (map_preview_panel) then icon else 0), 320, 0.0); - ui.draw_tiny_fill_bar ((preview_width - 160) / 2, 5 * (if view_list (map_preview_panel) then icon else 0), 160, 0.3, (255, 255, 0, 255)); - ui.draw_fill_bar ((preview_width - 320) / 2 + 400, 4 * (if view_list (map_preview_panel) then icon else 0), 320, 0.6); - ui.draw_tiny_fill_bar ((preview_width - 160) / 2 + 400, 5 * (if view_list (map_preview_panel) then icon else 0), 160, 0.6, (255, 0, 255, 255)); + resource.draw_points (player.resources, (preview_width - 4 * icon * resource.count) / 2, (if view_list (map_preview_panel) then icon else 0)); -- signal_list (signal_mode).all; -- diff --git a/source/world.adb b/source/world.adb index 69d378a..4a3e4f0 100644 --- a/source/world.adb +++ b/source/world.adb @@ -15,7 +15,7 @@ package body world is unit_limit : constant natural := 600; chad_limit : constant natural := 8; - tiles : core.sprite; + earth : core.sprite; dark : core.sprite; border_upper : core.sprite; border_lower : core.sprite; @@ -32,7 +32,7 @@ package body world is begin core.echo (core.comment, "Configuring world components..."); -- - tiles := core.import_sprite (core.folder & "/game/world/terrain/terrain.png", 1, 1); + earth := core.import_sprite (core.folder & "/game/world/terrain/earth.png", 1, 1); dark := core.import_sprite (core.folder & "/game/world/dark.png", 1, 1); border_upper := core.import_sprite (core.folder & "/game/world/frame/border_upper.png", 1, 1); border_lower := core.import_sprite (core.folder & "/game/world/frame/border_lower.png", 1, 1); @@ -66,7 +66,7 @@ package body world is map.width := width; map.height := height; -- - map.tiles := new tile_array (0 .. map.width - 1, 0 .. map.height - 1); + map.earth := new tile_array (0 .. map.width - 1, 0 .. map.height - 1); map.clips := new clip_array (0 .. map.width - 1, 0 .. map.height - 1); map.views := new view_array (0 .. map.width - 1, 0 .. map.height - 1); map.landmarks := new entity_array (1 .. landmark_limit); @@ -78,7 +78,7 @@ package body world is -- for x in 0 .. width - 1 loop for y in 0 .. height - 1 loop - map.tiles (x, y) := (if core.random (0, 23) < 20 then 0 else core.random (0, 23)); + map.earth (x, y) := (if core.random (0, 23) < 17 then 0 else core.random (0, 23)); map.clips (x, y) := false; map.views (x, y) := false; end loop; @@ -138,9 +138,6 @@ package body world is ------------------------------------------------------------------------------------------ procedure draw is - u : integer := 0; - v : integer := 0; - -- offset : core.vector := ((core.window_width - core.base) / 2, (core.window_height - core.base) / 2); begin @@ -180,14 +177,11 @@ package body world is exit when offset.x + (horizontal - core.camera.x) * core.base * core.zoom > core.window_width; -- if map.views (horizontal, vertical) then - u := core.base * biome'pos (map.kind) * 4; - v := core.base * map.tiles (horizontal, vertical); - -- - core.draw (data => tiles, + core.draw (data => earth, x => offset.x + (horizontal - core.camera.x) * core.base * core.zoom, y => offset.y + (vertical - core.camera.y) * core.base * core.zoom, - u => u, - v => v, + u => core.base * biome'pos (map.kind) * 4, + v => core.base * map.earth (horizontal, vertical), width => core.base, height => core.base); if core.cursor.x > offset.x + (horizontal - core.camera.x ) * core.base * core.zoom - 6 @@ -281,11 +275,11 @@ package body world is -- for vertical in 0 .. map.height - 1 loop for horizontal in 0 .. map.width - 1 loop - core.render_image (data => tiles, + core.render_image (data => earth, x => horizontal * core.base, y => vertical * core.base, u => core.base * biome'pos (map.kind) * 4, - v => core.base * map.tiles (horizontal, vertical), + v => core.base * map.earth (horizontal, vertical), width => core.base, height => core.base); end loop; diff --git a/source/world.ads b/source/world.ads index 9a7ad91..463fa17 100644 --- a/source/world.ads +++ b/source/world.ads @@ -42,7 +42,7 @@ package world is kind : biome; width : natural; height : natural; - tiles : access tile_array; + earth : access tile_array; clips : access clip_array; views : access view_array; landmarks : access entity_array;