// A clear work area left of the bot's starting point (the trade dock is to its right): open // sky 160 grains wide and 40 tall, over a flat stone floor. Money and a bag of building // stuff to build with. Sets FLOOR (the first row of the floor), BX, BY (the leftmost block // of the area that stands on the floor) and CAM (the middle of the area). money = 50000; const x0 = Math.max(4, SX - 170), x1 = SX - 10, y0 = SY - 40; window.FLOOR = SY + 40; for (let y = y0; y < FLOOR + 8; y++) for (let x = x0; x < x1; x++) { const i = y * W + x; bgm[i] = 0; setCell(i, y >= FLOOR ? STONE : EMPTY, AMB[y], y >= FLOOR ? F_NAT : 0); } // open sky down to the floor (the renderer draws cave wall behind empty cells below surfY) for (let x = x0; x < x1; x++) { surfY[x] = FLOOR; dirtY[x] = Math.max(dirtY[x], FLOOR + 8); } updateRoof(); window.BX = Math.ceil(x0 / 4) + 1; window.BY = Math.floor(FLOOR / 4) - 1; bag[RSTONE] = 400; bag[RBRICK] = 200; bagTotal = 600; window.CAM = [(x0 + x1) / 2, SY + 20];