diff pytouhou/game/item.py @ 208:d07506a2e16e

Implement autocollection of items.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Tue, 08 Nov 2011 22:10:44 -0800
parents 13918723d1bc
children 0595315d3880
line wrap: on
line diff
--- a/pytouhou/game/item.py
+++ b/pytouhou/game/item.py
@@ -51,6 +51,11 @@ class Item(object):
         self._sprite.angle = angle
 
 
+    def autocollect(self, player):
+        self.player = player
+        self.speed = 8.
+
+
     def on_collect(self, player_state):
         old_power = player_state.power