From f7e41d34198c9c7911833fb48c385d10138b2f3f Mon Sep 17 00:00:00 2001 From: JOJO <1498581755@qq.com> Date: Thu, 6 Aug 2026 15:07:38 +0800 Subject: [PATCH] =?UTF-8?q?=E9=92=A2=E7=90=B4Boss=E5=A4=A7=E6=BF=80?= =?UTF-8?q?=E5=85=89=E6=9C=80=E7=BB=88=E4=BF=AE=E6=AD=A3=EF=BC=9A5?= =?UTF-8?q?=E7=A7=92=E6=8C=81=E7=BB=AD=E6=97=B6=E9=97=B4+fill=E5=AE=9E?= =?UTF-8?q?=E5=BF=83=E5=AE=8C=E7=BE=8E=E5=AF=B9=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 激光持续时间从40帧改为300帧(5秒),匹配用户要求的'持续5秒后消退' - 大激光绘制改用fill实心风格: - 上半圆fill:圆心(bm.x1, bm.y1+pR),顶部=炮口bm.y1,底部直径=bm.y1+pR - 矩形fillRect:从半圆底部bm.y1+pR开始向下,宽度=直径bm.w,和半圆完美对接 - 白边fillRect:窄矩形在主体内 - 彻底去掉stroke描边弧线,消除弧线描边在不同位置的展开差异导致的缝隙 --- star-raid/js/enemies.js | 4 ++-- star-raid/js/render.js | 19 ++++++++++--------- 2 files changed, 12 insertions(+), 11 deletions(-) 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";} } }