钢琴Boss大激光半圆修正:最高点=炮口+和激光一起出现
- 圆心从(bm.x1,bm.y1)改为(bm.x1,bm.y1+pR),半圆最高点正好在炮口位置 - 删除(1-life/dur0)单独动画,半圆是激光本体一部分,和激光一起出现一起消失 - 删除dur0字段依赖
This commit is contained in:
parent
fc33de3879
commit
a206565ac1
@ -224,12 +224,12 @@ 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;
|
||||||
// 大激光起点扩口半圆(直径=激光宽度,半圆顶部向上凸起覆盖矩形上边)
|
// 大激光起点扩口半圆:直径=激光宽度,圆心在炮口下方pR处,最高点=炮口,和激光一起出现
|
||||||
if(bm.dmg>=90000){const pR=Math.min(bm.w*0.5,bm.w*0.5*(1-bm.life/(bm.dur0||1))+1);
|
if(bm.dmg>=90000){const pR=bm.w*0.5;
|
||||||
if(pR>1){ctx.fillStyle=bm.col;
|
ctx.fillStyle=bm.col;
|
||||||
ctx.beginPath();ctx.arc(bm.x1,bm.y1,pR,Math.PI,0);ctx.fill();
|
ctx.beginPath();ctx.arc(bm.x1,bm.y1+pR,pR,Math.PI,0);ctx.fill();
|
||||||
ctx.strokeStyle="#fff";ctx.lineWidth=Math.max(1,pR/3);
|
ctx.strokeStyle="#fff";ctx.lineWidth=Math.max(1,pR/3);
|
||||||
ctx.beginPath();ctx.arc(bm.x1,bm.y1,pR,Math.PI,0);ctx.stroke();}}
|
ctx.beginPath();ctx.arc(bm.x1,bm.y1+pR,pR,Math.PI,0);ctx.stroke();}
|
||||||
ctx.strokeStyle=bm.col;ctx.lineWidth=bm.w;
|
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