Mercurial > touhou
diff pytouhou/game/orb.py @ 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 | b9d2db93972f |
children | 6be9c99a3a24 |
line wrap: on
line diff
--- a/pytouhou/game/orb.py +++ b/pytouhou/game/orb.py @@ -12,16 +12,11 @@ ## GNU General Public License for more details. ## - -from pytouhou.game.element import Element -from pytouhou.game.sprite import Sprite from pytouhou.vm.anmrunner import ANMRunner class Orb(Element): - __slots__ = ('offset_x', 'offset_y', 'player_state', 'fire') - - def __init__(self, anm, index, player_state, fire_func): + def __init__(self, anm, index, player_state): Element.__init__(self) self.sprite = Sprite() @@ -31,19 +26,9 @@ class Orb(Element): self.offset_y = 0 self.player_state = player_state - self.fire = fire_func - - - @property - def x(self): - return self.player_state.x + self.offset_x - - - @property - def y(self): - return self.player_state.y + self.offset_y def update(self): self.anmrunner.run_frame() - + self.x = self.player_state.x + self.offset_x + self.y = self.player_state.y + self.offset_y