Mercurial > touhou
comparison pytouhou/game/laser.pyx @ 495:b32cef75df59
Drop an useless dependency on Player from Orb, on Game from Laser.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Mon, 14 Oct 2013 12:12:52 +0200 |
parents | 2276229282fd |
children | db28538cd399 |
comparison
equal
deleted
inserted
replaced
494:6be9c99a3a24 | 495:b32cef75df59 |
---|---|
12 ## GNU General Public License for more details. | 12 ## GNU General Public License for more details. |
13 ## | 13 ## |
14 | 14 |
15 from libc.math cimport cos, sin, M_PI as pi | 15 from libc.math cimport cos, sin, M_PI as pi |
16 | 16 |
17 from pytouhou.game.game cimport Game | |
17 from pytouhou.vm.anmrunner import ANMRunner | 18 from pytouhou.vm.anmrunner import ANMRunner |
18 | 19 |
19 | 20 |
20 cdef class LaserLaunchAnim(Element): | 21 cdef class LaserLaunchAnim(Element): |
21 def __init__(self, Laser laser, anm, unsigned long index): | 22 def __init__(self, Laser laser, anm, unsigned long index): |
54 unsigned long duration, unsigned long stop_duration, | 55 unsigned long duration, unsigned long stop_duration, |
55 unsigned long grazing_delay, | 56 unsigned long grazing_delay, |
56 unsigned long grazing_extra_duration, Game game): | 57 unsigned long grazing_extra_duration, Game game): |
57 Element.__init__(self, (0, 0)) | 58 Element.__init__(self, (0, 0)) |
58 | 59 |
59 self._game = game | |
60 launch_anim = LaserLaunchAnim(self, laser_type.anm, | 60 launch_anim = LaserLaunchAnim(self, laser_type.anm, |
61 laser_type.launch_anim_offsets[sprite_idx_offset] | 61 laser_type.launch_anim_offsets[sprite_idx_offset] |
62 + laser_type.launch_sprite_idx) | 62 + laser_type.launch_sprite_idx) |
63 self._game.effects.append(launch_anim) | 63 game.effects.append(launch_anim) |
64 self._laser_type = laser_type | 64 self._laser_type = laser_type |
65 self.state = STARTING | 65 self.state = STARTING |
66 | 66 |
67 #TODO: hitbox | 67 #TODO: hitbox |
68 | 68 |