comparison pytouhou/game/game.pyx @ 448:3bc37791f0a2

Make Bullet.state an enum.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Sat, 17 Aug 2013 17:44:11 +0200
parents 78e1c3864e73
children cae1ae9de430
comparison
equal deleted inserted replaced
447:78e1c3864e73 448:3bc37791f0a2
13 ## 13 ##
14 14
15 from pytouhou.vm.msgrunner import MSGRunner 15 from pytouhou.vm.msgrunner import MSGRunner
16 16
17 from pytouhou.game.element cimport Element 17 from pytouhou.game.element cimport Element
18 from pytouhou.game.bullet cimport Bullet 18 from pytouhou.game.bullet cimport Bullet, LAUNCHED, CANCELLED
19 from pytouhou.game.bullet import LAUNCHED, CANCELLED
20 from pytouhou.game.enemy cimport Enemy 19 from pytouhou.game.enemy cimport Enemy
21 from pytouhou.game.item cimport Item 20 from pytouhou.game.item cimport Item
22 from pytouhou.game.effect cimport Particle 21 from pytouhou.game.effect cimport Particle
23 from pytouhou.game.text import Text 22 from pytouhou.game.text import Text
24 from pytouhou.game.face import Face 23 from pytouhou.game.face import Face
289 288
290 289
291 cdef void update_msg(self, long keystate) except *: 290 cdef void update_msg(self, long keystate) except *:
292 cdef long k 291 cdef long k
293 292
294 if any([(keystate & k and not self.last_keystate & k) for k in (1, 256)]): 293 for k in (1, 256):
295 self.msg_runner.skip() 294 if keystate & k and not self.last_keystate & k:
295 self.msg_runner.skip()
296 break
296 self.msg_runner.skipping = bool(keystate & 256) 297 self.msg_runner.skipping = bool(keystate & 256)
297 self.last_keystate = keystate 298 self.last_keystate = keystate
298 self.msg_runner.run_iteration() 299 self.msg_runner.run_iteration()
299 300
300 301