钢琴Boss大激光半圆:中间加白圆匹配激光内芯

- 在半圆中间位置(圆心bm.x1, bm.y1+pR/2)加一个实心白圆
- 白圆半径pR/3,直径=2pR/3=bm.w/3,和激光矩形内芯宽度一致
- 白圆完全在实心半圆内部,模拟激光从炮口射出的白芯效果
This commit is contained in:
JOJO 2026-08-06 15:09:34 +08:00
parent f7e41d3419
commit 53733e6bfc

View File

@ -224,13 +224,14 @@ 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){ // 大激光fill实心上半圆+fillRect实心矩形边缘完美对接
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.beginPath();ctx.arc(bm.x1,bm.y1+pR,pR,0,Math.PI,true);ctx.fill(); // 上半圆
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));} // 白边窄矩形
ctx.beginPath();ctx.arc(bm.x1,bm.y1+pR/2,pR/3,0,TAU);ctx.fill(); // 半圆中间白圆,直径=内芯宽
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);