Mercurial > skaapsteker
changeset 410:115e738e209c
Become visible when attacking. Enemies shouldn't attack invisible foxes.
author | Simon Cross <hodgestar@gmail.com> |
---|---|
date | Sat, 09 Apr 2011 17:30:09 +0200 |
parents | ed26bbfec03a |
children | a5f54ae9217e |
files | skaapsteker/sprites/base.py skaapsteker/sprites/player.py |
diffstat | 2 files changed, 5 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/skaapsteker/sprites/base.py Sat Apr 09 17:26:25 2011 +0200 +++ b/skaapsteker/sprites/base.py Sat Apr 09 17:30:09 2011 +0200 @@ -190,6 +190,8 @@ self._done_attack = True def start_attack(self, player): + if player.invisible: + return if self._animation == 'attacking': return # We're already attacking elif self.attack_frame is not None:
--- a/skaapsteker/sprites/player.py Sat Apr 09 17:26:25 2011 +0200 +++ b/skaapsteker/sprites/player.py Sat Apr 09 17:30:09 2011 +0200 @@ -300,6 +300,7 @@ self.drop_item() def _bite_attack(self): + self.invisible = 0 self.attacking = 2 self._last_time = time.time() # Reset the animation clock @@ -312,11 +313,13 @@ AddSpriteEvent.post(projectile) def _fireball_attack(self): + self.invisible = 0 self.attacking = 2 self._last_time = time.time() # Reset the animation clock self._launch_projectile(Fireball) def _lightning_attack(self): + self.invisible = 0 self.attacking = 2 self._last_time = time.time() # Reset the animation clock self._launch_projectile(Lightning)