Преглед на файлове

Extended collision system to buildings...

master
Ognjen Milan Robovic преди 1 седмица
родител
ревизия
7c8b9432a4
променени са 3 файла, в които са добавени 14 реда и са изтрити 25 реда
  1. +0
    -4
      source/construction.adb
  2. +2
    -0
      source/construction.ads
  3. +12
    -21
      source/world.adb

+ 0
- 4
source/construction.adb Целия файл

@@ -8,10 +8,6 @@ package body construction is

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

sprite : array (enumeration) of core.sprite;

------------------------------------------------------------------------------------------

procedure configure is
begin
core.echo (core.comment, "Configuring construction components...");


+ 2
- 0
source/construction.ads Целия файл

@@ -35,6 +35,8 @@ package construction is
("Imp Den ", faction.imp, (others => 0), 1, effect.none)
);

sprite : array (enumeration) of core.sprite;

------------------------------------------------------------------------------------------

procedure configure;


+ 12
- 21
source/world.adb Целия файл

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

------------------------------------------------------------------------------------------


Loading…
Отказ
Запис