From 6c37585ef4ef2535aff8c45c64850be0a6c26eab Mon Sep 17 00:00:00 2001 From: Maksymilian Jopek Date: Thu, 2 Jun 2022 08:54:02 +0200 Subject: Death animations --- src/enemies/White.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/enemies/White.ts') diff --git a/src/enemies/White.ts b/src/enemies/White.ts index 2987985..e5b22ae 100644 --- a/src/enemies/White.ts +++ b/src/enemies/White.ts @@ -1,5 +1,5 @@ import { Rectangle } from "../Drawable"; -import { IMGS } from "../Images"; +import { getSmallDeathAnim, IMGS } from "../Images"; import Enemy from "./Enemy"; export default class White extends Enemy { @@ -11,7 +11,7 @@ export default class White extends Enemy { phase = 0; spriteNum = 1; i = 0; - squares: Rectangle[] = [new Rectangle(this, 2, 2, this.width - 2, this.height - 2)] + squares: Rectangle[] = [new Rectangle(this)] constructor(x: number, y: number, public left: boolean) { super(x, y) @@ -61,8 +61,11 @@ export default class White extends Enemy { this.y += dy; this.width = this.sprite.width this.height = this.sprite.height - this.squares = [new Rectangle(this, 2, 2, this.width - 2, this.height - 2)] + this.squares = [new Rectangle(this)] return this.isOutsideMap() } + + shoot(): boolean { return false } + deathAnim = getSmallDeathAnim(this) } -- cgit v1.3.1