diff options
Diffstat (limited to 'src/enemies/BigCircle.ts')
| -rw-r--r-- | src/enemies/BigCircle.ts | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/src/enemies/BigCircle.ts b/src/enemies/BigCircle.ts index 1f9f7dd..b7666f5 100644 --- a/src/enemies/BigCircle.ts +++ b/src/enemies/BigCircle.ts @@ -11,8 +11,11 @@ export default class BigCircle extends Enemy { height = 40 sprite: HTMLImageElement | string = IMGS.bigCircleDown; strSprite = "bigCircleDown" + si = 0; + changeSprite = true; vel = 2 - health = 20 + health = 30 + points = 1100 phase = 0; @@ -229,6 +232,23 @@ export default class BigCircle extends Enemy { break; } + if (this.health < 30 - 20) { + if (this.si++ > 3) { this.changeSprite = !this.changeSprite; this.si = 0; } + } + else if (this.health < 30 - 10) { + if (this.si++ > 8) { this.changeSprite = !this.changeSprite; this.si = 0; } + } + else if (this.health < 30) { + if (this.si++ > 30) { this.changeSprite = !this.changeSprite; this.si = 0; } + } + if (this.changeSprite === true && this.health < 30) + //@ts-expect-error + this.sprite = IMGS[this.strSprite + "Red"] + else + //@ts-expect-error + this.sprite = IMGS[this.strSprite] + + this.x += xShift; this.y += yShift; return this.x2 < 0 || this.y2 < 0 || this.x > canvas.width || this.y > canvas.height |
