diff options
| author | Maksymilian Jopek <maks@jopek.eu> | 2022-05-24 18:25:43 +0200 |
|---|---|---|
| committer | Maksymilian Jopek <maks@jopek.eu> | 2022-05-24 18:25:43 +0200 |
| commit | 2f8b8c87fb2062313afea7b625ccb20d1bea95b9 (patch) | |
| tree | 973e20986e4b9279b9322a9fd140e6f989eaf492 /src/enemies/Enemy.ts | |
| download | 1942-2f8b8c87fb2062313afea7b625ccb20d1bea95b9.tar.gz 1942-2f8b8c87fb2062313afea7b625ccb20d1bea95b9.tar.zst 1942-2f8b8c87fb2062313afea7b625ccb20d1bea95b9.zip | |
Initial commit
Diffstat (limited to 'src/enemies/Enemy.ts')
| -rw-r--r-- | src/enemies/Enemy.ts | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/enemies/Enemy.ts b/src/enemies/Enemy.ts new file mode 100644 index 0000000..607a612 --- /dev/null +++ b/src/enemies/Enemy.ts @@ -0,0 +1,12 @@ +import Bullet from "../drawables/Bullet"; +import { BULLET_VEL } from "../consts"; +import Drawable, { Rectangle } from "../Drawable"; + +export default abstract class Enemy extends Drawable { + squares: Array<Rectangle> = [new Rectangle(this)] + points = 5; + + shoot(bullet: Bullet[]) { + bullet.push(new Bullet(this.x + (this.width / 2) - Bullet.width / 2, this.y2, 0, BULLET_VEL, true)) + } +} |
