|
|
@@ -64,8 +64,18 @@ package body world is |
|
|
|
-- |
|
|
|
for index in 1 .. 30 loop |
|
|
|
map.constructions (index).index := core.random (0, construction.count - 1); |
|
|
|
map.constructions (index).x := core.random (0, map.width - 1); |
|
|
|
map.constructions (index).y := core.random (0, map.height - 1); |
|
|
|
map.constructions (index).x := core.random (6, map.width - 6); |
|
|
|
map.constructions (index).y := core.random (6, map.height - 6); |
|
|
|
-- |
|
|
|
declare reach_x : constant natural := construction.sprite (construction.enumeration'val (map.constructions (index).index)).width / core.base; |
|
|
|
reach_y : constant natural := construction.sprite (construction.enumeration'val (map.constructions (index).index)).height / core.base; |
|
|
|
begin |
|
|
|
for x in 0 .. reach_x - 1 loop |
|
|
|
for y in 0 .. reach_y - 1 loop |
|
|
|
map.clips (map.constructions (index).x + x, map.constructions (index).y + y) := true; |
|
|
|
end loop; |
|
|
|
end loop; |
|
|
|
end; |
|
|
|
end loop; |
|
|
|
-- |
|
|
|
for index in 1 .. 60 loop |
|
|
@@ -145,25 +155,6 @@ 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; |
|
|
|
--~-- |
|
|
|
--~u := core.base * biome'pos (map.kind) * 4; |
|
|
|
--~v := core.base * map.tiles (horizontal, vertical); |
|
|
|
--~-- |
|
|
|
--~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, |
|
|
|
--~u => u, |
|
|
|
--~v => v, |
|
|
|
--~width => core.base, |
|
|
|
--~height => core.base); |
|
|
|
--~end loop; |
|
|
|
--~end loop; |
|
|
|
end draw; |
|
|
|
|
|
|
|
------------------------------------------------------------------------------------------ |
|
|
|