# HG changeset patch # User Adrianna PiƄska # Date 1252143989 0 # Node ID 9a6ac9c9ff466344a03d92f5fbc456239b7da25f # Parent d0760fccce1451667f67a4f8403c36801a91c76e chickens turn to face target foxes diff -r d0760fccce14 -r 9a6ac9c9ff46 gamelib/animal.py --- a/gamelib/animal.py Sat Sep 05 09:23:16 2009 +0000 +++ b/gamelib/animal.py Sat Sep 05 09:46:29 2009 +0000 @@ -50,11 +50,11 @@ self._fix_face(new_pos) self.pos = new_pos - def _fix_face(self, final_pos): + def _fix_face(self, facing_pos): """Set the face correctly""" - if final_pos.left_of(self.pos): + if facing_pos.left_of(self.pos): self._set_image_facing('left') - elif final_pos.right_of(self.pos): + elif facing_pos.right_of(self.pos): self._set_image_facing('right') def _set_image_facing(self, facing): @@ -181,6 +181,7 @@ fox = self._find_killable_fox(weapon, gameboard) if not fox: return + self._fix_face(fox.pos) if weapon.hit(gameboard, self, fox): sound.play_sound("kill-fox.ogg") gameboard.kill_fox(fox)