diff pytouhou/game/bullet.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 ebfd328e700c
line wrap: on
line diff
--- a/pytouhou/game/bullet.py
+++ b/pytouhou/game/bullet.py
@@ -107,6 +107,12 @@ class Bullet(object):
                                                    (self.speed,), 16)
 
 
+    def collide(self, player):
+        #TODO: animation
+        self._removed = True
+        player.die()
+
+
     def update(self):
         dx, dy = self.launch_delta
         self.x += dx