diff options
| author | Maksymilian Jopek <maks@jopek.eu> | 2022-06-02 23:13:07 +0200 |
|---|---|---|
| committer | Maksymilian Jopek <maks@jopek.eu> | 2022-06-02 23:16:33 +0200 |
| commit | b4defa324a330217f0139f1240bcf53c0b1f996a (patch) | |
| tree | deabb94fd351b10d3d6b38d967424149536b3927 /src/enemies/Enemy.ts | |
| parent | ef76266d1a61c02f1721efedc830fab12279d2b9 (diff) | |
| download | 1942-b4defa324a330217f0139f1240bcf53c0b1f996a.tar.gz 1942-b4defa324a330217f0139f1240bcf53c0b1f996a.tar.zst 1942-b4defa324a330217f0139f1240bcf53c0b1f996a.zip | |
v1.0.0
Diffstat (limited to 'src/enemies/Enemy.ts')
| -rw-r--r-- | src/enemies/Enemy.ts | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/enemies/Enemy.ts b/src/enemies/Enemy.ts index 224e66c..cebc1d2 100644 --- a/src/enemies/Enemy.ts +++ b/src/enemies/Enemy.ts @@ -5,13 +5,16 @@ import Anime from "../Animation"; export default abstract class Enemy extends Drawable { squares: Array<Rectangle> = [new Rectangle(this)] - points = 5; + points = 50; health = 2 deathAnim!: Anime; + constructor(x: number, y: number) { + super(x, y) + } shoot(bullet: Bullet[]): boolean { if (this.y2 < TOPBAR_HEIGHT) return false - bullet.push(new Bullet(this.x + (this.width / 2) - Bullet.width / 2, this.y2, 0, BULLET_VEL, false)) + bullet.push(new Bullet(this.x + (this.width / 2) - Bullet.width / 2, this.y2, 0, BULLET_VEL / 1.5, false)) return true } } |
