Mercurial > fife-parpg
comparison demos/shooter/scripts/ships/shipbase.py @ 454:bd7e8f708adf
Time is now managed by the Scene object.
Enemy projectiles are now a bit slower.
author | prock@33b003aa-7bff-0310-803a-e67f0ece8222 |
---|---|
date | Tue, 06 Apr 2010 21:25:10 +0000 |
parents | cf53848fb187 |
children | 302a69c5141d |
comparison
equal
deleted
inserted
replaced
453:cf53848fb187 | 454:bd7e8f708adf |
---|---|
29 | 29 |
30 | 30 |
31 class Ship(SpaceObject): | 31 class Ship(SpaceObject): |
32 def __init__(self, scene, name, findInstance=True): | 32 def __init__(self, scene, name, findInstance=True): |
33 super(Ship, self).__init__(scene, name, findInstance) | 33 super(Ship, self).__init__(scene, name, findInstance) |
34 | 34 |
35 self._timedelta = 0 | |
36 self._weapon = None | 35 self._weapon = None |
37 | 36 |
38 def _setWeapon(self, weapon): | 37 def _setWeapon(self, weapon): |
39 self._weapon = weapon | 38 self._weapon = weapon |
40 | 39 |
41 def _getWeapon(self, weapon): | 40 def _getWeapon(self): |
42 return self._weapon | 41 return self._weapon |
43 | 42 |
44 def fire(self, curtime, direction): | 43 def fire(self, direction): |
45 if self._weapon: | 44 if self._weapon: |
46 return self._weapon.fire(curtime, direction) | 45 return self._weapon.fire(direction) |
47 | 46 |
48 return None | 47 return None |
49 | 48 |
50 weapon = property(_getWeapon, _setWeapon) | 49 weapon = property(_getWeapon, _setWeapon) |
51 | 50 |