diff pytouhou/game/player.pxd @ 445:b0abb05811f7

Make pytouhou.game.player an extension type, and move the GameOver exception there since it makes more sense.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Sat, 17 Aug 2013 04:44:28 +0200
parents
children 78e1c3864e73
line wrap: on
line diff
new file mode 100644
--- /dev/null
+++ b/pytouhou/game/player.pxd
@@ -0,0 +1,22 @@
+from pytouhou.game.element cimport Element
+
+cdef class PlayerState:
+    cdef public double x, y
+    cdef public bint touchable, focused
+    cdef public long character, score, effective_score, lives, bombs, power, graze, points, invulnerable_time, power_bonus
+
+
+cdef class Player(Element):
+    cdef public PlayerState state
+    cdef public object _game
+    cdef public long death_time
+
+    cdef object anm
+    cdef tuple speeds
+    cdef long fire_time, direction
+
+    cdef void set_anim(self, index)
+    cpdef play_sound(self, str name)
+    cpdef collide(self)
+    cdef void fire(self)
+    cpdef update(self, long keystate)