|
|
@@ -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; |
|
|
|
|
|
|
|
------------------------------------------------------------------------------------------ |
|
|
|