Mercurial > touhou
comparison pytouhou/game/enemy.py @ 440:b9d2db93972f
Add a base Element class for every object in pytouhou.game.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Fri, 30 Aug 2013 14:16:08 +0200 |
parents | d778db08190f |
children |
comparison
equal
deleted
inserted
replaced
439:723a3e67a223 | 440:b9d2db93972f |
---|---|
13 ## | 13 ## |
14 | 14 |
15 | 15 |
16 from pytouhou.utils.interpolator import Interpolator | 16 from pytouhou.utils.interpolator import Interpolator |
17 from pytouhou.vm.anmrunner import ANMRunner | 17 from pytouhou.vm.anmrunner import ANMRunner |
18 from pytouhou.game.element import Element | |
18 from pytouhou.game.sprite import Sprite | 19 from pytouhou.game.sprite import Sprite |
19 from pytouhou.game.bullet import Bullet | 20 from pytouhou.game.bullet import Bullet |
20 from pytouhou.game.laser import Laser | 21 from pytouhou.game.laser import Laser |
21 from pytouhou.game.effect import Effect | 22 from pytouhou.game.effect import Effect |
22 from math import cos, sin, atan2, pi | 23 from math import cos, sin, atan2, pi |
23 from pytouhou.game.bullet import LAUNCHED | 24 from pytouhou.game.bullet import LAUNCHED |
24 | 25 |
25 | 26 |
26 class Enemy(object): | 27 class Enemy(Element): |
27 def __init__(self, pos, life, _type, bonus_dropped, die_score, anms, game): | 28 def __init__(self, pos, life, _type, bonus_dropped, die_score, anms, game): |
29 Element.__init__(self) | |
30 | |
28 self._game = game | 31 self._game = game |
29 self._anms = anms | 32 self._anms = anms |
30 self._type = _type | 33 self._type = _type |
31 | 34 |
32 self.process = None | 35 self.process = None |
33 self.sprite = None | |
34 self.anmrunner = None | |
35 self.removed = False | |
36 self.visible = True | 36 self.visible = True |
37 self.was_visible = False | 37 self.was_visible = False |
38 self.bonus_dropped = bonus_dropped | 38 self.bonus_dropped = bonus_dropped |
39 self.die_score = die_score | 39 self.die_score = die_score |
40 | 40 |