From b4defa324a330217f0139f1240bcf53c0b1f996a Mon Sep 17 00:00:00 2001 From: Maksymilian Jopek Date: Thu, 2 Jun 2022 23:13:07 +0200 Subject: v1.0.0 --- src/enemies/Straight.ts | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src/enemies/Straight.ts') diff --git a/src/enemies/Straight.ts b/src/enemies/Straight.ts index 7bc82f9..f57d6f3 100644 --- a/src/enemies/Straight.ts +++ b/src/enemies/Straight.ts @@ -9,11 +9,19 @@ export default class Straight extends Enemy { sprite = IMGS.simpleDown; width = IMGS.simpleDown.width; height = IMGS.simpleDown.height; - vel = 2 + vel = 2.5 phase = 0; spriteNum = 1; i = 0; - squares: Rectangle[] = [new Rectangle(this, 2, 2, this.width - 2, this.height - 2)] + squares: Rectangle[] = [new Rectangle(this, 2, 2, this.width - 4, this.height - 4)] + drop = false + + constructor(x: number, y: number, drop?: boolean) { + super(x, y) + if (drop) this.drop = drop + this.height = IMGS.simpleDown.height; + this._y = y - this.height + } move() { let dy = 0; @@ -35,7 +43,7 @@ export default class Straight 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, 2, 2, this.width - 4, this.height - 4)] return this.y + this.height < 0 } -- cgit v1.3.1