diff --git a/star-raid/js/enemies.js b/star-raid/js/enemies.js index 4d05471..a173b49 100644 --- a/star-raid/js/enemies.js +++ b/star-raid/js/enemies.js @@ -361,7 +361,7 @@ function updateBoss(){ else if(l>0&&l<60){ if(p.dead<=0&&Math.abs(p.x-leftX)<14)b.pedLasL=l+1; else b.pedLasL=Math.max(0,l-1); - if(b.pedLasL>=60){bossBeam(leftX,b.y+10,leftX,H+8,14,"#ff3355",10,40,99999,{b,ox:-(112+off0),oy:10,followX2:true});b.pedLasL=0;b.pedLasLCd=300;SFX.warn();}}} + if(b.pedLasL>=60){bossBeam(leftX,b.y+10,leftX,H+8,14,"#ff3355",10,300,99999,{b,ox:-(112+off0),oy:10,followX2:true});b.pedLasL=0;b.pedLasLCd=300;SFX.warn();}}} // 右炮 if((b.pedLasRCd||0)>0){b.pedLasRCd=b.pedLasRCd-1;} else{const r=b.pedLasR||0; @@ -369,7 +369,7 @@ function updateBoss(){ else if(r>0&&r<60){ if(p.dead<=0&&Math.abs(p.x-rightX)<14)b.pedLasR=r+1; else b.pedLasR=Math.max(0,r-1); - if(b.pedLasR>=60){bossBeam(rightX,b.y+10,rightX,H+8,14,"#ff3355",10,40,99999,{b,ox:(112+off0),oy:10,followX2:true});b.pedLasR=0;b.pedLasRCd=300;SFX.warn();}}} + if(b.pedLasR>=60){bossBeam(rightX,b.y+10,rightX,H+8,14,"#ff3355",10,300,99999,{b,ox:(112+off0),oy:10,followX2:true});b.pedLasR=0;b.pedLasRCd=300;SFX.warn();}}} } // —— 主攻击 —— b.mainT--; diff --git a/star-raid/js/render.js b/star-raid/js/render.js index 16fb0d2..34b01f3 100644 --- a/star-raid/js/render.js +++ b/star-raid/js/render.js @@ -224,16 +224,17 @@ function drawBossFx(){ ctx.beginPath();ctx.moveTo(bm.x1,bm.y1);ctx.lineTo(bm.x2,bm.y2);ctx.stroke();ctx.globalAlpha=1;}} else{ctx.globalCompositeOperation="lighter"; ctx.globalAlpha=clamp(bm.life/10,0,1)*0.85; - // 大激光起点扩口半圆:弧线描边风格与激光线完全一致(粗主色弧+细白边弧) - if(bm.dmg>=90000){const pR=bm.w*0.5; - ctx.strokeStyle=bm.col;ctx.lineWidth=bm.w; - ctx.beginPath();ctx.arc(bm.x1,bm.y1+pR,pR,Math.PI,0);ctx.stroke(); + if(bm.dmg>=90000){ // 大激光:fill实心上半圆+fillRect实心矩形,边缘完美对接 + const pR=bm.w*0.5; + ctx.fillStyle=bm.col; + ctx.beginPath();ctx.arc(bm.x1,bm.y1+pR,pR,0,Math.PI,true);ctx.fill(); // 上半圆:顶部=炮口bm.y1,底部直径=bm.y1+pR + ctx.fillRect(bm.x1-pR,bm.y1+pR,bm.w,bm.y2-(bm.y1+pR)); // 矩形:从半圆底部向下,宽=直径 + ctx.fillStyle="#fff"; + ctx.fillRect(bm.x1-pR/3,bm.y1+pR,pR*2/3,bm.y2-(bm.y1+pR));} // 白边窄矩形 + else{ctx.strokeStyle=bm.col;ctx.lineWidth=bm.w; + ctx.beginPath();ctx.moveTo(bm.x1,bm.y1);ctx.lineTo(bm.x2,bm.y2);ctx.stroke(); ctx.strokeStyle="#fff";ctx.lineWidth=Math.max(1,bm.w/3); - ctx.beginPath();ctx.arc(bm.x1,bm.y1+pR,pR,Math.PI,0);ctx.stroke();} - ctx.strokeStyle=bm.col;ctx.lineWidth=bm.w; - ctx.beginPath();ctx.moveTo(bm.x1,bm.y1+bm.w);ctx.lineTo(bm.x2,bm.y2);ctx.stroke(); - ctx.strokeStyle="#fff";ctx.lineWidth=Math.max(1,bm.w/3); - ctx.beginPath();ctx.moveTo(bm.x1,bm.y1+bm.w);ctx.lineTo(bm.x2,bm.y2);ctx.stroke(); + ctx.beginPath();ctx.moveTo(bm.x1,bm.y1);ctx.lineTo(bm.x2,bm.y2);ctx.stroke();} ctx.globalAlpha=1;ctx.globalCompositeOperation="source-over";} } }