mirror of
https://github.com/unanmed/HumanBreak.git
synced 2026-11-03 18:24:30 +08:00
fix: 分裂弹幕在摧毁后应该分裂
This commit is contained in:
1 parent
fc3a8fb81f
commit
8b5f94b65b
3 files changed
+45
No files matched your search
@@ -69,6 +69,9 @@ export class SplittableBall extends Projectile<PalaceBoss> {
|
||||
private ax: number = 0;
|
||||
private ay: number = 0;
|
||||
|
||||
/** 是否已经分裂过 */
|
||||
private splitted: boolean = false;
|
||||
|
||||
static init(colors: Record<string, string[]>) {
|
||||
this.ball.clear();
|
||||
for (const [key, color] of Object.entries(colors)) {
|
||||
@@ -192,6 +195,8 @@ export class SplittableBall extends Projectile<PalaceBoss> {
|
||||
|
||||
private split(boss: PalaceBoss) {
|
||||
if (!this.splitData?.split) return;
|
||||
if (this.splitted) return;
|
||||
this.splitted = true;
|
||||
const {
|
||||
startAngle,
|
||||
endAngle,
|
||||
@@ -258,4 +263,9 @@ export class SplittableBall extends Projectile<PalaceBoss> {
|
||||
const ctx = canvas.ctx;
|
||||
ctx.drawImage(texture.canvas, this.x - 16, this.y - 16, 32, 32);
|
||||
}
|
||||
|
||||
destroy(): void {
|
||||
this.split(this.boss);
|
||||
super.destroy();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user