ソースを参照

Extended landmarks collision to be any size, aka landmark sprite dependent.

master
コミット
58598f03c0
3個のファイルの変更15行の追加6行の削除
  1. +12
    -4
      source/world.adb
  2. +3
    -2
      source/world.ads
  3. バイナリ
      sprite/world/landmark/pine_forest.png

+ 12
- 4
source/world.adb ファイルの表示

@@ -53,12 +53,20 @@ package body world is
end loop;
--
for index in 1 .. landmark_limit loop
map.landmarks (index).index := core.random (0, 8);
map.landmarks (index).x := core.random (0, map.width - 1);
map.landmarks (index).y := core.random (0, map.height - 1);
map.landmarks (index).index := core.random (0, 9);
map.landmarks (index).x := core.random (6, map.width - 6);
map.landmarks (index).y := core.random (6, map.height - 6);
--
if trait (landmark_index'val (map.landmarks (index).index)).clip then
map.clips (map.landmarks (index).x, map.landmarks (index).y) := true;
declare reach_x : constant natural := landmarks (landmark_index'val (map.landmarks (index).index)).width / core.base;
reach_y : constant natural := landmarks (landmark_index'val (map.landmarks (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.landmarks (index).x + x, map.landmarks (index).y + y) := true;
end loop;
end loop;
end;
end if;
end loop;
--


+ 3
- 2
source/world.ads ファイルの表示

@@ -15,8 +15,8 @@ package world is
------------------------------------------------------------------------------------------

type landmark_index is (
dead_tree, mossy_rock, palm_tree, pine_tree, reeds, rock,
snowed_pine_tree, snowed_rock, spiky_rock
dead_tree, mossy_rock, palm_tree, pine_tree, pine_forest, reeds,
rock, snowed_pine_tree, snowed_rock, spiky_rock
);

type landmark_trait is record
@@ -59,6 +59,7 @@ package world is
mossy_rock => (swamp, true, 1),
palm_tree => (sand, true, 4),
pine_tree => (grass, true, 4),
pine_forest => (grass, true, 4),
reeds => (swamp, false, 4),
rock => (sand, true, 1),
snowed_pine_tree => (snow, true, 4),


バイナリ
sprite/world/landmark/pine_forest.png ファイルの表示

変更前 変更後
幅: 192  |  高さ: 32  |  サイズ: 2.0KB

読み込み中…
キャンセル
保存