diff pytouhou/game/enemy.pyx @ 545:bcff39c920ab

Set boss mode directly from the enemy.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Thu, 15 May 2014 20:14:54 +0200
parents 53fa73932e9a
children e35bef07290d
line wrap: on
line diff
--- a/pytouhou/game/enemy.pyx
+++ b/pytouhou/game/enemy.pyx
@@ -309,6 +309,16 @@ cdef class Enemy(Element):
                                                formula)
 
 
+    cpdef set_boss(self, bint enable):
+        if enable:
+            self.boss = True
+            self._game.boss = self
+            self._game.interface.set_boss_life()
+        else:
+            self.boss = False
+            self._game.boss = None
+
+
     cdef bint is_visible(self, long screen_width, long screen_height):
         if self.sprite is not None:
             if self.sprite.corner_relative_placement: