钢琴Boss大激光:白半圆与红半圆同心,底部对齐
- 白半圆圆心改为和红色半圆相同(bm.x1, bm.y1+pR),半径pR/3 - 白矩形起点改为bm.y1+pR,和红色半圆/矩形底部完美对齐 - 白芯从红色半圆下半部分开始,向下贯穿整个矩形,不再断裂
This commit is contained in:
parent
cf41515239
commit
de33f67343
@ -224,14 +224,14 @@ function drawBossFx(){
|
|||||||
ctx.beginPath();ctx.moveTo(bm.x1,bm.y1);ctx.lineTo(bm.x2,bm.y2);ctx.stroke();ctx.globalAlpha=1;}}
|
ctx.beginPath();ctx.moveTo(bm.x1,bm.y1);ctx.lineTo(bm.x2,bm.y2);ctx.stroke();ctx.globalAlpha=1;}}
|
||||||
else{ctx.globalCompositeOperation="lighter";
|
else{ctx.globalCompositeOperation="lighter";
|
||||||
ctx.globalAlpha=clamp(bm.life/10,0,1)*0.85;
|
ctx.globalAlpha=clamp(bm.life/10,0,1)*0.85;
|
||||||
if(bm.dmg>=90000){ // 大激光:fill实心上半圆+fillRect实心矩形,中间加白圆匹配激光内芯
|
if(bm.dmg>=90000){ // 大激光:外层红半圆+红矩形,内层白半圆+白矩形,全部同心底部对齐
|
||||||
const pR=bm.w*0.5;
|
const pR=bm.w*0.5;
|
||||||
ctx.fillStyle=bm.col;
|
ctx.fillStyle=bm.col;
|
||||||
ctx.beginPath();ctx.arc(bm.x1,bm.y1+pR,pR,0,Math.PI,true);ctx.fill(); // 上半圆
|
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.fillRect(bm.x1-pR,bm.y1+pR,bm.w,bm.y2-(bm.y1+pR)); // 红矩形
|
||||||
ctx.fillStyle="#fff";
|
ctx.fillStyle="#fff";
|
||||||
ctx.beginPath();ctx.arc(bm.x1,bm.y1+pR/3,pR/3,0,Math.PI,true);ctx.fill(); // 上半圆里的白半圆,顶部=炮口,和激光内芯等宽
|
ctx.beginPath();ctx.arc(bm.x1,bm.y1+pR,pR/3,0,Math.PI,true);ctx.fill(); // 白半圆(与红半圆同心,底部对齐)
|
||||||
ctx.fillRect(bm.x1-pR/3,bm.y1+pR/3,pR*2/3,bm.y2-(bm.y1+pR/3));} // 主矩形内芯,从白半圆底部开始
|
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;
|
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.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.strokeStyle="#fff";ctx.lineWidth=Math.max(1,bm.w/3);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user