Mercurial > touhou
comparison pytouhou/game/enemy.pyx @ 447:78e1c3864e73
Make pytouhou.game.game an extension type.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Sat, 17 Aug 2013 06:29:53 +0200 |
parents | cae83b963695 |
children | 3bc37791f0a2 |
comparison
equal
deleted
inserted
replaced
446:3a33ed7f3b85 | 447:78e1c3864e73 |
---|---|
20 from pytouhou.game.laser import Laser | 20 from pytouhou.game.laser import Laser |
21 from pytouhou.game.effect cimport Effect | 21 from pytouhou.game.effect cimport Effect |
22 | 22 |
23 | 23 |
24 cdef class Enemy(Element): | 24 cdef class Enemy(Element): |
25 def __init__(self, pos, long life, long _type, long bonus_dropped, long die_score, anms, game): | 25 def __init__(self, pos, long life, long _type, long bonus_dropped, long die_score, anms, Game game): |
26 Element.__init__(self) | 26 Element.__init__(self) |
27 | 27 |
28 self._game = game | 28 self._game = game |
29 self._anms = anms | 29 self._anms = anms |
30 self._type = _type | 30 self._type = _type |
270 self.speed_interpolator = Interpolator((self.speed,), frame, | 270 self.speed_interpolator = Interpolator((self.speed,), frame, |
271 (0.,), frame + duration - 1, | 271 (0.,), frame + duration - 1, |
272 formula) | 272 formula) |
273 | 273 |
274 | 274 |
275 cpdef bint is_visible(self, long screen_width, long screen_height): | 275 cdef bint is_visible(self, long screen_width, long screen_height): |
276 cdef double tw, th | 276 cdef double tw, th |
277 | 277 |
278 if self.sprite is not None: | 278 if self.sprite is not None: |
279 if self.sprite.corner_relative_placement: | 279 if self.sprite.corner_relative_placement: |
280 raise Exception #TODO | 280 raise Exception #TODO |