fix: canAttack
This commit is contained in:
parent
a226cb977b
commit
beb3c97878
|
@ -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) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user