comparison pytouhou/game/player.pyx @ 606:3c2f96f1d715

Fix compilation under Cython 0.22, by making the pyx and the pxd declarations’ except clause similar.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Wed, 26 Nov 2014 13:36:38 +0100
parents e15672733c93
children 2cf518129725
comparison
equal deleted inserted replaced
605:d6ead6f0ba80 606:3c2f96f1d715
66 self.set_anim(0) 66 self.set_anim(0)
67 67
68 self.death_time = 0 68 self.death_time = 0
69 69
70 70
71 cdef void set_anim(self, index): 71 cdef void set_anim(self, index) except *:
72 self.sprite = Sprite() 72 self.sprite = Sprite()
73 self.anmrunner = ANMRunner(self.anm, index, self.sprite) 73 self.anmrunner = ANMRunner(self.anm, index, self.sprite)
74 74
75 75
76 cdef void play_sound(self, str name): 76 cdef void play_sound(self, str name) except *:
77 self._game.sfx_player.play('%s.wav' % name) 77 self._game.sfx_player.play('%s.wav' % name)
78 78
79 79
80 cdef void collide(self): 80 cdef void collide(self) except *:
81 if not self.invulnerable_time and not self.death_time and self.touchable: # Border Between Life and Death 81 if not self.invulnerable_time and not self.death_time and self.touchable: # Border Between Life and Death
82 self.death_time = self._game.frame 82 self.death_time = self._game.frame
83 self._game.new_effect((self.x, self.y), 17) 83 self._game.new_effect((self.x, self.y), 17)
84 self._game.modify_difficulty(-1600) 84 self._game.modify_difficulty(-1600)
85 self.play_sound('pldead00') 85 self.play_sound('pldead00')
93 93
94 def stop_focusing(self): 94 def stop_focusing(self):
95 self.focused = False 95 self.focused = False
96 96
97 97
98 cdef void fire(self): 98 cdef void fire(self) except *:
99 cdef long shot_power 99 cdef long shot_power
100 100
101 sht = self.focused_sht if self.focused else self.sht 101 sht = self.focused_sht if self.focused else self.sht
102 102
103 # Don’t use min() since sht.shots could be an empty dict. 103 # Don’t use min() since sht.shots could be an empty dict.