From c7253308a39ce7eb925698c227dd6f9ecda31bb6 Mon Sep 17 00:00:00 2001 From: xolatile Date: Sun, 2 Jun 2024 08:42:47 -0400 Subject: [PATCH] Added arrow rendering... --- source/world.adb | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/source/world.adb b/source/world.adb index 41c4382..adc75a2 100644 --- a/source/world.adb +++ b/source/world.adb @@ -123,6 +123,42 @@ package body world is y => offset.y + (target.y - core.camera.y) * core.base * core.zoom, factor => core.zoom); -- + if target /= (-1, -1) then + declare step : core.vector := core.camera; + size : constant integer := core.base * core.zoom; + begin + --~loop exit when step.x = target.x - 1; + --~loop exit when step.y = target.y - 1; + if step.x < target.x and step.y < target.y then + core.draw (arrow_lower_right, offset.x + (step.x + 1 - core.camera.x) * size, offset.y + (step.y + 1 - core.camera.y) * size, factor => core.zoom); + step.x := step.x + 1; step.y := step.y + 1; + elsif step.x > target.x and step.y < target.y then + core.draw (arrow_lower_left, offset.x + (step.x - 1 - core.camera.x) * size, offset.y + (step.y + 1 - core.camera.y) * size, factor => core.zoom); + step.x := step.x - 1; step.y := step.y + 1; + elsif step.x = target.x and step.y < target.y then + core.draw (arrow_lower, offset.x + (step.x - core.camera.x) * size, offset.y + (step.y + 1 - core.camera.y) * size, factor => core.zoom); + step.y := step.y + 1; + elsif step.x < target.x and step.y = target.y then + core.draw (arrow_right, offset.x + (step.x + 1 - core.camera.x) * size, offset.y + (step.y - core.camera.y) * size, factor => core.zoom); + step.x := step.x + 1; + elsif step.x > target.x and step.y = target.y then + core.draw (arrow_left, offset.x + (step.x - 1 - core.camera.x) * size, offset.y + (step.y - core.camera.y) * size, factor => core.zoom); + step.x := step.x - 1; + elsif step.x < target.x and step.y > target.y then + core.draw (arrow_upper_right, offset.x + (step.x + 1 - core.camera.x) * size, offset.y + (step.y - 1 - core.camera.y) * size, factor => core.zoom); + step.x := step.x + 1; step.y := step.y - 1; + elsif step.x > target.x and step.y > target.y then + core.draw (arrow_upper_left, offset.x + (step.x - 1 - core.camera.x) * size, offset.y + (step.y - 1 - core.camera.y) * size, factor => core.zoom); + step.x := step.x - 1; step.y := step.y - 1; + elsif step.x = target.x and step.y > target.y then + core.draw (arrow_upper, offset.x + (step.x - core.camera.x) * size, offset.y + (step.y - 1 - core.camera.y) * size, factor => core.zoom); + step.y := step.y - 1; + end if; + --~end loop; + --~end loop; + end; + end if; + -- draw_tiles_timer := natural (1_000_000.0 * (core.time - time)); end draw_tiles;