diff pytouhou/game/player.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 f26c8ab57257
line wrap: on
line diff
--- a/pytouhou/game/player.py
+++ b/pytouhou/game/player.py
@@ -13,6 +13,7 @@
 ##
 
 
+from pytouhou.game.element import Element
 from pytouhou.game.sprite import Sprite
 from pytouhou.vm.anmrunner import ANMRunner
 from pytouhou.game.bullettype import BulletType
@@ -52,11 +53,11 @@ class PlayerState(object):
                            self.power, self.lives, self.bombs)
 
 
-class Player(object):
+class Player(Element):
     def __init__(self, state, game, anm):
+        Element.__init__(self)
+
         self._game = game
-        self.sprite = None
-        self.anmrunner = None
         self.anm = anm
 
         self.speeds = (self.sht.horizontal_vertical_speed,