comparison demos/shooter/scripts/common/baseobject.py @ 479:ab28994820dd

Added some powerups including a spread weapon and an extra life. Fixed the problem where the player could fly off the screen.
author prock@33b003aa-7bff-0310-803a-e67f0ece8222
date Fri, 23 Apr 2010 17:17:02 +0000
parents 6b33d80b468b
children c4168eb47a44
comparison
equal deleted inserted replaced
478:41f7754f2a4b 479:ab28994820dd
29 SHTR_DEFAULT = 0 29 SHTR_DEFAULT = 0
30 SHTR_PLAYER = 1 30 SHTR_PLAYER = 1
31 SHTR_LASTBOSS = 2 31 SHTR_LASTBOSS = 2
32 SHTR_PROJECTILE = 3 32 SHTR_PROJECTILE = 3
33 SHTR_ENEMYSHIP = 4 33 SHTR_ENEMYSHIP = 4
34 SHTR_POWERUP = 5
34 35
35 36
36 class SpaceObject(object): 37 class SpaceObject(object):
37 def __init__(self, scene, name, findInstance=True): 38 def __init__(self, scene, name, findInstance=True):
38 self._scene = scene 39 self._scene = scene
141 def _getInstance(self): 142 def _getInstance(self):
142 return self._instance 143 return self._instance
143 144
144 def _setInstance(self, instance): 145 def _setInstance(self, instance):
145 self._instance = instance 146 self._instance = instance
147 if self._instance:
148 self._instance.thisown = 0
146 149
147 def _getVelocity(self): 150 def _getVelocity(self):
148 return self._velocity 151 return self._velocity
149 152
150 def _setVelocity(self, velocity): 153 def _setVelocity(self, velocity):