feat: 优化boss战表现

This commit is contained in:
unanmed 2024-11-18 23:22:27 +08:00
parent 31605615ce
commit 63a21c8afa

View File

@ -806,8 +806,12 @@ export class ThunderBallProjectile extends Projectile<TowerBoss> {
const hor = ThunderBallProjectile.horizontal!.canvas;
const ver = ThunderBallProjectile.vertical!.canvas;
ctx.save();
ctx.globalAlpha = 1;
if (w > 0 && h > 0) {
if (this.time > 1000 && this.time < 3000) {
ctx.globalAlpha = (3000 - this.time) / 2000;
} else {
ctx.globalAlpha = 1;
}
if (w > 0 && h > 0 && this.time < 3000) {
switch (this.direction) {
case ProjectileDirection.BottomToTop:
case ProjectileDirection.TopToBottom: {
@ -821,6 +825,7 @@ export class ThunderBallProjectile extends Projectile<TowerBoss> {
}
}
}
ctx.globalAlpha = 1;
ctx.fillStyle = '#fff';
ctx.shadowBlur = 8;
ctx.shadowColor = '#62c8f4';