fix: canAttack

This commit is contained in:
Renge 2022-04-30 19:38:55 -04:00
parent a226cb977b
commit beb3c97878
2 changed files with 8 additions and 0 deletions

View File

@ -12,6 +12,10 @@ export default class BullAI extends EnemyAI {
this.attackTimer = new Timer(4000);
}
canAttack(position: Vec2): boolean {
return this.attackTimer.isStopped();
}
collideWithPlayer(player: PlayerController): void {
player.damage(10);
if (this.isAttaking && !player.invincible && !player.godMode) {

View File

@ -17,6 +17,10 @@ export default class TigerAI extends EnemyAI {
return null;
}
canAttack(position: Vec2): boolean {
return this.attackTimer.isStopped();
}
collideWithPlayer(player: PlayerController): void {
player.damage(10);
if (this.isAttaking && !player.invincible && !player.godMode) {