Mercurial > touhou
comparison pytouhou/game/laser.pxd @ 471:06f0eeb519bb
Make Laser and Orb extension types, and use that where possible.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Mon, 16 Sep 2013 18:42:04 +0200 |
parents | |
children | 8038f1957b71 |
comparison
equal
deleted
inserted
replaced
470:98995d8ac744 | 471:06f0eeb519bb |
---|---|
1 from pytouhou.game.element cimport Element | |
2 from pytouhou.game.sprite cimport Sprite | |
3 from pytouhou.game.game cimport Game | |
4 | |
5 cdef enum State: | |
6 STARTING, STARTED, STOPPING | |
7 | |
8 | |
9 cdef class LaserLaunchAnim(Element): | |
10 cdef Laser _laser | |
11 | |
12 cpdef update(self) | |
13 | |
14 | |
15 cdef class Laser(Element): | |
16 cdef public unsigned long frame | |
17 cdef public double angle | |
18 | |
19 cdef unsigned long start_duration, duration, stop_duration, grazing_delay, | |
20 cdef unsigned long grazing_extra_duration, sprite_idx_offset | |
21 cdef double base_pos[2], speed, start_offset, end_offset, max_length, width | |
22 cdef State state | |
23 cdef Game _game | |
24 cdef object _laser_type | |
25 | |
26 cdef void set_anim(self, long sprite_idx_offset=*) except * | |
27 cpdef set_base_pos(self, double x, double y) | |
28 cdef bint _check_collision(self, double point[2], double border_size) | |
29 cdef bint check_collision(self, double point[2]) | |
30 cdef bint check_grazing(self, double point[2]) | |
31 #def get_bullets_pos(self) | |
32 cpdef cancel(self) | |
33 cpdef update(self) | |
34 | |
35 | |
36 cdef class PlayerLaser(Element): | |
37 cdef double hitbox[2], angle, offset | |
38 cdef unsigned long frame, duration, sprite_idx_offset, damage | |
39 cdef Element origin | |
40 cdef object _laser_type | |
41 | |
42 cdef void set_anim(self, long sprite_idx_offset=*) except * | |
43 cdef void cancel(self) except * | |
44 cdef void update(self) except * |