diff pytouhou/game/item.py @ 445:b0abb05811f7

Make pytouhou.game.player an extension type, and move the GameOver exception there since it makes more sense.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Sat, 17 Aug 2013 04:44:28 +0200
parents b9d2db93972f
children
line wrap: on
line diff
--- a/pytouhou/game/item.py
+++ b/pytouhou/game/item.py
@@ -168,7 +168,8 @@ class Item(Element):
                                                    (3.,), 180)
 
         if self.player is not None:
-            self.angle = atan2(self.player.y - self.y, self.player.x - self.x)
+            player_state = self.player.state
+            self.angle = atan2(player_state.y - self.y, player_state.x - self.x)
             self.x += cos(self.angle) * self.speed
             self.y += sin(self.angle) * self.speed
         elif self.speed_interpolator is None: