annotate 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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
471
06f0eeb519bb Make Laser and Orb extension types, and use that where possible.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
1 from pytouhou.game.element cimport Element
06f0eeb519bb Make Laser and Orb extension types, and use that where possible.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
2 from pytouhou.game.sprite cimport Sprite
06f0eeb519bb Make Laser and Orb extension types, and use that where possible.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
3 from pytouhou.game.game cimport Game
06f0eeb519bb Make Laser and Orb extension types, and use that where possible.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
4
06f0eeb519bb Make Laser and Orb extension types, and use that where possible.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
5 cdef enum State:
06f0eeb519bb Make Laser and Orb extension types, and use that where possible.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
6 STARTING, STARTED, STOPPING
06f0eeb519bb Make Laser and Orb extension types, and use that where possible.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
7
06f0eeb519bb Make Laser and Orb extension types, and use that where possible.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
8
06f0eeb519bb Make Laser and Orb extension types, and use that where possible.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
9 cdef class LaserLaunchAnim(Element):
06f0eeb519bb Make Laser and Orb extension types, and use that where possible.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
10 cdef Laser _laser
06f0eeb519bb Make Laser and Orb extension types, and use that where possible.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
11
06f0eeb519bb Make Laser and Orb extension types, and use that where possible.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
12 cpdef update(self)
06f0eeb519bb Make Laser and Orb extension types, and use that where possible.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
13
06f0eeb519bb Make Laser and Orb extension types, and use that where possible.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
14
06f0eeb519bb Make Laser and Orb extension types, and use that where possible.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
15 cdef class Laser(Element):
06f0eeb519bb Make Laser and Orb extension types, and use that where possible.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
16 cdef public unsigned long frame
06f0eeb519bb Make Laser and Orb extension types, and use that where possible.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
17 cdef public double angle
06f0eeb519bb Make Laser and Orb extension types, and use that where possible.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
18
06f0eeb519bb Make Laser and Orb extension types, and use that where possible.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
19 cdef unsigned long start_duration, duration, stop_duration, grazing_delay,
06f0eeb519bb Make Laser and Orb extension types, and use that where possible.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
20 cdef unsigned long grazing_extra_duration, sprite_idx_offset
06f0eeb519bb Make Laser and Orb extension types, and use that where possible.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
21 cdef double base_pos[2], speed, start_offset, end_offset, max_length, width
06f0eeb519bb Make Laser and Orb extension types, and use that where possible.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
22 cdef State state
06f0eeb519bb Make Laser and Orb extension types, and use that where possible.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
23 cdef Game _game
06f0eeb519bb Make Laser and Orb extension types, and use that where possible.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
24 cdef object _laser_type
06f0eeb519bb Make Laser and Orb extension types, and use that where possible.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
25
06f0eeb519bb Make Laser and Orb extension types, and use that where possible.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
26 cdef void set_anim(self, long sprite_idx_offset=*) except *
06f0eeb519bb Make Laser and Orb extension types, and use that where possible.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
27 cpdef set_base_pos(self, double x, double y)
06f0eeb519bb Make Laser and Orb extension types, and use that where possible.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
28 cdef bint _check_collision(self, double point[2], double border_size)
06f0eeb519bb Make Laser and Orb extension types, and use that where possible.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
29 cdef bint check_collision(self, double point[2])
06f0eeb519bb Make Laser and Orb extension types, and use that where possible.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
30 cdef bint check_grazing(self, double point[2])
06f0eeb519bb Make Laser and Orb extension types, and use that where possible.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
31 #def get_bullets_pos(self)
06f0eeb519bb Make Laser and Orb extension types, and use that where possible.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
32 cpdef cancel(self)
06f0eeb519bb Make Laser and Orb extension types, and use that where possible.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
33 cpdef update(self)
06f0eeb519bb Make Laser and Orb extension types, and use that where possible.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
34
06f0eeb519bb Make Laser and Orb extension types, and use that where possible.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
35
06f0eeb519bb Make Laser and Orb extension types, and use that where possible.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
36 cdef class PlayerLaser(Element):
06f0eeb519bb Make Laser and Orb extension types, and use that where possible.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
37 cdef double hitbox[2], angle, offset
06f0eeb519bb Make Laser and Orb extension types, and use that where possible.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
38 cdef unsigned long frame, duration, sprite_idx_offset, damage
06f0eeb519bb Make Laser and Orb extension types, and use that where possible.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
39 cdef Element origin
06f0eeb519bb Make Laser and Orb extension types, and use that where possible.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
40 cdef object _laser_type
06f0eeb519bb Make Laser and Orb extension types, and use that where possible.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
41
06f0eeb519bb Make Laser and Orb extension types, and use that where possible.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
42 cdef void set_anim(self, long sprite_idx_offset=*) except *
06f0eeb519bb Make Laser and Orb extension types, and use that where possible.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
43 cdef void cancel(self) except *
06f0eeb519bb Make Laser and Orb extension types, and use that where possible.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
44 cdef void update(self) except *