aboutsummaryrefslogtreecommitdiffstats
path: root/src/enemies/White.ts
diff options
context:
space:
mode:
authorMaksymilian Jopek <maks@jopek.eu>2022-06-02 08:54:02 +0200
committerMaksymilian Jopek <maks@jopek.eu>2022-06-02 08:54:02 +0200
commit6c37585ef4ef2535aff8c45c64850be0a6c26eab (patch)
treec53e07505182735fbd23687a0c731d4bb2f10e14 /src/enemies/White.ts
parent7a494b148dd03d6346a63641fc479015e7450a26 (diff)
download1942-6c37585ef4ef2535aff8c45c64850be0a6c26eab.tar.gz
1942-6c37585ef4ef2535aff8c45c64850be0a6c26eab.tar.zst
1942-6c37585ef4ef2535aff8c45c64850be0a6c26eab.zip
Death animations
Diffstat (limited to 'src/enemies/White.ts')
-rw-r--r--src/enemies/White.ts9
1 files changed, 6 insertions, 3 deletions
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)
}