30 lines
1.7 KiB
JavaScript
30 lines
1.7 KiB
JavaScript
// Paused comparison scene: ordinary grains, fog, heat, trees and exceptional geometry.
|
|
const cx = (W / 3) & ~3, cy = 180;
|
|
window.CAM = [cx, cy];
|
|
SET.fog = true; SET.shake = false; SET.cameraLead = false;
|
|
weather.next = 1e15; R.rain = 0;
|
|
for (let y = cy - 52; y < cy + 52; y++) for (let x = cx - 90; x < cx + 90; x++) {
|
|
const i = y * W + x;
|
|
setCell(i, y >= cy + 24 ? STONE : EMPTY, 20, y >= cy + 24 ? F_NAT : 0);
|
|
bgm[i] = part[i] = mach[i] = occ[i] = 0; blockP[(y >> 2) * BW + (x >> 2)] = 0;
|
|
}
|
|
for (let x = cx - 90; x < cx + 90; x++) { surfY[x] = cy + 16; dirtY[x] = cy + 30; graniteY[x] = cy + 38; basaltY[x] = cy + 46; }
|
|
const fill = (x0,y0,w,h,m,T=20) => { for(let y=y0;y<y0+h;y++)for(let x=x0;x<x0+w;x++)setCell(y*W+x,m,T,F_NAT); };
|
|
fill(cx-62,cy+6,22,16,WATER); fill(cx-34,cy+11,16,11,MAGMA,1450);
|
|
fill(cx-33,cy+3,8,8,FIRE,900); fill(cx-12,cy+17,15,6,SAND);
|
|
fill(cx-10,cy+24,12,5,STONE,1100);
|
|
for(let y=cy-20;y<cy+16;y++)for(let x=cx-58;x<cx-54;x++)bgm[y*W+x]=WOOD;
|
|
for(let y=cy-28;y<cy-12;y++)for(let x=cx-68;x<cx-44;x++)if((x-cx+56)**2+(y-cy+20)**2<130)bgm[y*W+x]=LEAVES;
|
|
for(let x=cx-40;x<cx-34;x++)digp[(cy+24)*W+x]=160;
|
|
const place=(code,v,dx,dy)=>{const e=placeBlock(code,v,(cx+dx)>>2,(cy+dy)>>2,true);if(e)throw Error(e);};
|
|
for(let dx=-36;dx<-12;dx+=4)place(BP_BELT,1,dx,-12);
|
|
place(BP_SCREW,1,-4,-12); place(BP_SCREW,4,0,-12);
|
|
place(BP_BELT_UP,1,16,-12);place(BP_BELT_UP,1,20,-16);
|
|
place(BP_PIPE,0,32,-12);place(BP_PIPE,0,36,-12);
|
|
addMold('ingot',(cx+8)>>2,(cy+8)>>2,RSTONE,true);
|
|
spawnBar(BARCU,cx-25,cy-16,0,0,700);
|
|
flyers.push({x:cx-8,y:cy-18,m:SAND,rain:false});
|
|
ghostBlocks.set(((cy-4)>>2)*BW+((cx-4)>>2),[BP_WALL,RSTONE]);
|
|
for(let j=0;j<FH;j++)for(let i=0;i<FW;i++)fog[j*FW+i]=Math.max(0,Math.min(255,(cx+72-i*FOG)*5));
|
|
updateRoof(); rebuildPower();
|