Mercurial > touhou
comparison pytouhou/game/orb.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 | 1222341ea22c |
children | 06f0eeb519bb |
comparison
equal
deleted
inserted
replaced
439:723a3e67a223 | 440:b9d2db93972f |
---|---|
11 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 ## GNU General Public License for more details. | 12 ## GNU General Public License for more details. |
13 ## | 13 ## |
14 | 14 |
15 | 15 |
16 from pytouhou.game.element import Element | |
16 from pytouhou.game.sprite import Sprite | 17 from pytouhou.game.sprite import Sprite |
17 from pytouhou.vm.anmrunner import ANMRunner | 18 from pytouhou.vm.anmrunner import ANMRunner |
18 | 19 |
19 | 20 |
20 class Orb(object): | 21 class Orb(Element): |
21 __slots__ = ('sprite', 'anmrunner', 'offset_x', 'offset_y', 'player_state', | 22 __slots__ = ('offset_x', 'offset_y', 'player_state', 'fire') |
22 'fire') | |
23 | 23 |
24 def __init__(self, anm, index, player_state, fire_func): | 24 def __init__(self, anm, index, player_state, fire_func): |
25 Element.__init__(self) | |
26 | |
25 self.sprite = Sprite() | 27 self.sprite = Sprite() |
26 self.anmrunner = ANMRunner(anm, index, self.sprite) | 28 self.anmrunner = ANMRunner(anm, index, self.sprite) |
27 | 29 |
28 self.offset_x = 0 | 30 self.offset_x = 0 |
29 self.offset_y = 0 | 31 self.offset_y = 0 |