Revise terrain targetting
This commit is contained in:
parent
3ee5ae3d8f
commit
46827f3428
1 changed files with 11 additions and 13 deletions
24
island.ts
24
island.ts
|
@ -164,22 +164,20 @@ export function IslandApplet() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function tick() {
|
function tick() {
|
||||||
const islandTiles = islands.floodSearch(basePos, (tile) => tile > 0);
|
const lowlandTiles = islands.floodSearch(basePos + 12, (tile) => tile > 0);
|
||||||
dropWithin(islandTiles);
|
|
||||||
|
|
||||||
// focus shore
|
// grow shore
|
||||||
dropWithin(islandTiles.filter((pos) => islands.data[pos] == 0));
|
const shoreTiles = lowlandTiles.filter((pos) => islands.data[pos] == 0);
|
||||||
|
dropWithin(shoreTiles);
|
||||||
|
dropWithin(shoreTiles);
|
||||||
|
|
||||||
// form forest
|
// seed beach
|
||||||
const hill = islands
|
const beachTiles = lowlandTiles.filter((pos) => islands.data[pos] == 1);
|
||||||
.floodSearch(basePos + 12, (tile) => tile >= 2)
|
dropWithin(beachTiles);
|
||||||
.filter((pos) => islands.data[pos] == 2);
|
|
||||||
dropWithin(hill);
|
|
||||||
|
|
||||||
// grow forest
|
// expand forest
|
||||||
const forestTiles = islandTiles.filter(
|
const forestTiles = lowlandTiles.filter((pos) => islands.data[pos] == 2);
|
||||||
(pos) => islands.data[pos] >= 2 && islands.data[pos] <= 3
|
dropWithin(forestTiles);
|
||||||
);
|
|
||||||
dropWithin(forestTiles);
|
dropWithin(forestTiles);
|
||||||
dropWithin(forestTiles);
|
dropWithin(forestTiles);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue