comparison demos/shooter/scripts/common/baseobject.py @ 476:78a1eb57c074

Changed the way instances get deleted from the scene. Instances now get removed at the end of the frame as opposed to after their explosion action is complete. The old way was causing the odd segfault because the instance was being removed before FIFE was finished with it.
author prock@33b003aa-7bff-0310-803a-e67f0ece8222
date Thu, 22 Apr 2010 01:18:44 +0000
parents b78020d31186
children 6b33d80b468b
comparison
equal deleted inserted replaced
475:afde89c1d50b 476:78a1eb57c074
110 110
111 self._velocity.x += (norm.x * (self._scene.timedelta/1000.0))/self._xscale 111 self._velocity.x += (norm.x * (self._scene.timedelta/1000.0))/self._xscale
112 self._velocity.y += (norm.y * (self._scene.timedelta/1000.0))/self._yscale 112 self._velocity.y += (norm.y * (self._scene.timedelta/1000.0))/self._yscale
113 113
114 def removeFromScene(self): 114 def removeFromScene(self):
115 self._scene.removeObjectFromScene(self) 115 self._scene.queueObjectForRemoval(self)
116 if self._instance: 116 # if self._instance:
117 self._layer.deleteInstance(self._instance) 117 # self._layer.deleteInstance(self._instance)
118 self._instance = None 118 # self._instance = None
119 119
120 def _isRunning(self): 120 def _isRunning(self):
121 return self._running 121 return self._running
122 122
123 def _getMaxVelocity(self): 123 def _getMaxVelocity(self):