Mercurial > fife-parpg
diff demos/shooter/scripts/ships/shipbase.py @ 474:10aff123c62c
Some minor code cleanups.
Changed the player ship controls a little to feel more natural.
author | prock@33b003aa-7bff-0310-803a-e67f0ece8222 |
---|---|
date | Wed, 21 Apr 2010 16:49:59 +0000 |
parents | 7a79dc2a0592 |
children | 6b33d80b468b |
line wrap: on
line diff
--- a/demos/shooter/scripts/ships/shipbase.py Tue Apr 20 20:36:58 2010 +0000 +++ b/demos/shooter/scripts/ships/shipbase.py Wed Apr 21 16:49:59 2010 +0000 @@ -43,6 +43,9 @@ else: self._ship._flashing = False self._ship._flashnumber = 0 + + if action.getId() == 'explode' and not self._ship.isplayer: + self._ship.removeFromScene() class Ship(SpaceObject): def __init__(self, scene, name, findInstance=True): @@ -65,9 +68,10 @@ return self._weapon def flash(self, number): - self._instance.act('flash', self._instance.getFacingLocation()) - self._flashnumber = number - self._flashing = True + if self._running: + self._instance.act('flash', self._instance.getFacingLocation()) + self._flashnumber = number + self._flashing = True def fire(self, direction): if self._weapon and self._hitpoints > 0: