Added arrow rendering...
This commit is contained in:
parent
9c23103d05
commit
c7253308a3
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user