21 lines
1005 B
JavaScript
21 lines
1005 B
JavaScript
// A twelve-block funnel, one block open at the bottom, draining 400 grains of sand.
|
|
const fx = Math.floor((SX - 150) / BS), fy = Math.floor((SY - 36) / BS);
|
|
const cx = (fx + 12) * BS + 2, floor = (fy + 25) * BS;
|
|
for (let y = fy * BS - 45; y < floor + 8; y++) for (let x = fx * BS - 20; x < (fx + 25) * BS + 20; x++) {
|
|
const i = y * W + x;
|
|
bgm[i] = 0;
|
|
setCell(i, y >= floor ? STONE : EMPTY, 20, y >= floor ? F_NAT : 0);
|
|
}
|
|
for (let x = fx * BS - 20; x < (fx + 25) * BS + 20; x++) surfY[x] = floor;
|
|
bot.x = cx; bot.y = fy * BS + 24;
|
|
bagAdd(RBRICK, 192, true);
|
|
GAME.pieceDir.wall = 0;
|
|
for (const [ax, ay, bx, by] of [[fx, fy, fx + 11, fy + 11], [fx + 24, fy, fx + 13, fy + 11]]) {
|
|
GAME.drag = { bx: ax, by: ay };
|
|
placeBlocks(pieceCode(PIECE_BY_ID.wall, { bx, by }), RBRICK, blockLine(ax, ay, bx, by, true));
|
|
}
|
|
GAME.drag = null;
|
|
for (let y = fy * BS - 28; y < fy * BS - 18; y++) for (let x = cx - 20; x < cx + 20; x++) setCell(y * W + x, SAND, 20, 0);
|
|
updateRoof();
|
|
window.CAM = [cx, fy * BS + 25];
|