// Self-contained: a flat feed climbs, crosses the top, and runs downhill; a filter sorts below. const left = Math.max(8, ((SX - 176) >> 2) * 4), base = ((SY - 20) >> 2), bx0 = left >> 2; const ground = (base + 22) * 4; for (let y = (base - 16) * 4; y < ground + 8; y++) for (let x = left; x < left + 188; x++) { const i = y * W + x; mat[i] = y >= ground ? STONE : EMPTY; part[i] = 0; mach[i] = 0; bgm[i] = 0; flags[i] = y >= ground ? F_NAT : 0; temp[i] = 20; wakeXY(x, y); } for (let x = left; x < left + 188; x++) { surfY[x] = ground; dirtY[x] = ground + 8; } AMB.fill(20); money = 50000; weather.next = 1e15; for (let k = 4; k < 10; k++) placeBlock(BP_BELT, 1, bx0 + k, base + 1, true); for (let k = 0; k < 10; k++) placeBlock(BP_BELT_UP, 1, bx0 + 10 + k, base - k, true); for (let k = 20; k < 26; k++) placeBlock(BP_BELT, 1, bx0 + k, base - 9, true); for (let k = 0; k < 10; k++) placeBlock(BP_BELT_DOWN, 1, bx0 + 26 + k, base - 9 + k, true); for (let k = 36; k < 43; k++) placeBlock(BP_BELT, 1, bx0 + k, base + 1, true); const low = base + 16; for (let k = 4; k < 10; k++) placeBlock(BP_BELT, 1, bx0 + k, low + 1, true); for (let k = 0; k < 10; k++) placeBlock(BP_FILTER_UP, 128, bx0 + 10 + k, low - k, true, {m:[SAND],inv:0}); for (let k = 20; k < 30; k++) placeBlock(BP_BELT, 1, bx0 + k, low - 9, true); for (let k = 0; k < 380; k++) { for (let l = 1; l <= 4; l++) { let i = ((base + 1) * 4 - l) * W + left + 20; if (mat[i] === EMPTY) setCell(i, SAND, 20, 0); i = ((low + 1) * 4 - l) * W + left + 20; if (mat[i] === EMPTY) setCell(i, (k + l) & 1 ? SAND : GRAVEL, 20, 0); } simTick(); } spawnBar(BARCU, left + 92, (base - 9) * 4 - BAR_H, 0, 0, 20); window.CAM = [left + 92, (base + 6) * 4]; window.SLOPE_CAM = [left + 64, (base - 4) * 4]; updateRoof();