Added map revealing thing...

This commit is contained in:
Ognjen Milan Robovic 2024-05-08 17:14:49 -04:00
parent faad7fac15
commit e73d65ec9a
3 changed files with 24 additions and 2 deletions

View File

@ -105,7 +105,7 @@ procedure main is
procedure introduction is
begin
ui.write ("Heyo world!", 0, 0);
ui.write ("[-- Please press Spacebar to continue]", 0, 0);
end introduction;
------------------------------------------------------------------------------------------

View File

@ -8,11 +8,16 @@ package body world is
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
dark : core.sprite;
------------------------------------------------------------------------------------------
procedure configure is
begin
core.echo (core.comment, "Configuring world components...");
--
tiles := core.import_sprite ("./sprite/world/terrain/terrain.png", 1, 1);
dark := core.import_sprite ("./sprite/dark.png", 1, 1);
--
for index in landmark_index loop
declare file : constant string := core.lowercase (index'image);
@ -121,7 +126,7 @@ package body world is
--
core.draw (data => tiles,
x => offset.x + (horizontal - core.camera.x) * core.base * core.zoom,
y => offset.y + (vertical - core.camera.y) * core.base * core.zoom,
y => offset.y + (vertical - core.camera.y) * core.base * core.zoom,
u => u,
v => v,
width => core.base,
@ -163,6 +168,23 @@ package body world is
offset.y + (map.items (index).y - core.camera.y) * core.base * core.zoom);
end if;
end loop;
--
for vertical in 0 .. map.height - 1 loop
exit when offset.y + (vertical - core.camera.y) * core.base * core.zoom > core.window_height;
--
for horizontal in 0 .. map.width - 1 loop
exit when offset.x + (horizontal - core.camera.x) * core.base * core.zoom > core.window_width;
--
if not (horizontal > core.camera.x - 6
and horizontal < core.camera.x + 6
and vertical > core.camera.y - 6
and vertical < core.camera.y + 6) then
core.draw (data => dark,
x => offset.x + (horizontal - core.camera.x) * core.base * core.zoom,
y => offset.y + (vertical - core.camera.y) * core.base * core.zoom);
end if;
end loop;
end loop;
end draw;
------------------------------------------------------------------------------------------

Binary file not shown.

Before

Width:  |  Height:  |  Size: 122 B

After

Width:  |  Height:  |  Size: 107 B