diff pytouhou/game/item.py @ 152:86807b8a63bd

Add collisions with enemies and items.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Sun, 09 Oct 2011 15:32:43 -0700
parents 5cf927cbd9c5
children 37df8c618c2e
line wrap: on
line diff
--- a/pytouhou/game/item.py
+++ b/pytouhou/game/item.py
@@ -38,6 +38,11 @@ class Item(object):
         self._sprite.angle = angle
 
 
+    def collect(self, player):
+        player.state.score += self._item_type.score
+        self._removed = True
+
+
     def update(self):
         dx, dy = self.delta