diff --git a/public/tide-pool-world.js b/public/tide-pool-world.js index 9bc8593..4dff19c 100644 --- a/public/tide-pool-world.js +++ b/public/tide-pool-world.js @@ -698,10 +698,16 @@ function build(world, around) { const c = world.creatures.find(o => o.sp === 'artificer'); if (!c) return; const home = { x: c.x, z: c.z }; - const site = around(1, 3.5, true); - if (site) for (let n = 0; n < 90; n++) { - c.x = site.x + (world.random() - .5) * 1.6; c.z = site.z + (world.random() - .5) * 1.6; - placeBlock(world, c, 0); + // A low builder that reaches out rather than up; its children take after it. + c.style = { tall: .3, reach: 1.7, dwell: .7, solid: .25 }; + // It has worked its way along the pool's edge, a part or two at a time, so the structure runs low and long from the rock + // out over the water rather than heaping up in one place, and nothing stands more than a few parts above its ground. + const from = world.random() * Math.PI * 2, arc = 2.4 + world.random() * .8; + for (let n = 0; n < 64; n++) { + const a = from + arc * n / 64, r = START_POOL.r * (.78 + .12 * Math.sin(n * .7)) + (world.random() - .5) * .6; + c.x = START_POOL.x + Math.cos(a) * r; c.z = START_POOL.z + Math.sin(a) * r * .8; + const b = placeBlock(world, c, 0); + if (b && b.k - groundLevel(world, b.i, b.j) > 4) removeBlock(world, b); } for (const b of world.blocks.values()) { b.born = world.time - 60; if (b.kind === 'wheel') b.charge = .8; } c.site = null; diff --git a/public/tide-pool.js b/public/tide-pool.js index 7450867..1a1f11d 100644 --- a/public/tide-pool.js +++ b/public/tide-pool.js @@ -1,7 +1,7 @@ import { createWorld, advanceWorld, offerObject, SPECIES, SPECIES_ORDER, CELL, COLS, ROWS, X0, Z0, X1, Z1, START_POOL, waterLevel, daylight, heightAt, surfaceAt, depthAt, onShelf, bodyAt, tideOf, tideRising, label, goalText, describeWorld, creatureById, MACHINES, BLOCK, BLOCK_Y0, blockKey, footAt, debrisAt, footing, stormAt, shineLantern, douseLantern, moonlight, SWELL, swellHeight, cellAt, -} from './tide-pool-world.js?v=41'; +} from './tide-pool-world.js?v=42'; const root = document.querySelector('[data-tide-pool]'); const status = document.querySelector('#tide-status'); diff --git a/scripts/tide-pool.test.mjs b/scripts/tide-pool.test.mjs index 082e5b5..f0f59e1 100644 --- a/scripts/tide-pool.test.mjs +++ b/scripts/tide-pool.test.mjs @@ -28,7 +28,8 @@ test('a settled shelf opens lived in: builders at work, a structure in its pool, const species = new Set(world.creatures.map(c => c.sp)); for (const sp of ['scraper', 'tab', 'pylon', 'borer', 'collector', 'artificer']) assert.ok(species.has(sp), `${sp} is already here`); assert.ok(!species.has('breaker'), 'the breaker is still to come'); - assert.ok(world.blocks.size >= 60, `${world.blocks.size} parts stand`); + assert.ok(world.blocks.size >= 40, `${world.blocks.size} parts stand`); + assert.ok([...world.blocks.values()].every(b => b.k - Math.floor((world.h[b.j * 128 + b.i] + 2.5) / BLOCK) <= 4), "and none stands high"); assert.ok(world.machines.some(m => m.kind === 'beacon' && m.have >= m.need), 'a finished beacon'); assert.ok(daylight(world) > .9 && waterLevel(world) < 0, 'afternoon, the tide below half'); run(world, 30); diff --git a/src/components/tide-pool.tsx b/src/components/tide-pool.tsx index 6cd9a80..1922cce 100644 --- a/src/components/tide-pool.tsx +++ b/src/components/tide-pool.tsx @@ -191,7 +191,7 @@ export function TidePoolContent() {
Rendered with Three.js. Software license.
- + ); }