From: Skullheadx <704277@pdsb.net> Date: Thu, 7 Jul 2022 21:10:12 +0000 (-0400) Subject: Update Enemy.py X-Git-Url: http://git.skullheadx.com/nixos/blog/static/gitweb.css?a=commitdiff_plain;h=5f402bb9b70552a8bae5c6c7ba24007fa0ed07a3;p=Pygame-Jam.git Update Enemy.py --- diff --git a/Enemy.py b/Enemy.py index 2c6122c..054fcb5 100644 --- a/Enemy.py +++ b/Enemy.py @@ -26,8 +26,9 @@ class Enemy(Actor): super().update(delta) if target is not None and self.dizzy_time == 0: self.follow_target(target,stop_dist=self.weapon.width * 0.8 + self.width + target.width) - if self.weapon.get_collision_rect().colliderect(target.get_collision_rect()): + if not self.weapon.attacking and self.weapon.get_collision_rect().colliderect(target.get_collision_rect()): self.weapon.swing() + target.attack(self, self.weapon) self.dizzy_time -= delta self.dizzy_time = max(0,self.dizzy_time)