diff pytouhou/game/game.pyx @ 497:3da7395f39e3

Make enemy callbacks programmables.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Mon, 14 Oct 2013 12:20:55 +0200
parents 6be9c99a3a24
children 3d3285918ba1
line wrap: on
line diff
--- a/pytouhou/game/game.pyx
+++ b/pytouhou/game/game.pyx
@@ -203,10 +203,9 @@ cdef class Game:
                 pass # Bosses are immune to 96
             elif enemy.touchable:
                 enemy.life = 0
-            elif enemy.death_callback > 0:
+            else:
                 #TODO: check
-                enemy.process.switch_to_sub(enemy.death_callback)
-                enemy.death_callback = -1
+                enemy.death_callback.fire()
 
 
     cpdef new_effect(self, pos, long anim, anm=None, long number=1):