aboutsummaryrefslogtreecommitdiffstats
path: root/src/enemies/Enemy.ts
blob: 607a6127efcdde4381b983c4d6fd7e658f717520 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
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))
  }
}