Mercurial > fife-parpg
comparison demos/shooter/scripts/ships/enemies.py @ 647:f2b3512d0e60
* hope this fixes the bug in the shooter demo that causes a crash after killing the boss.
author | prock@33b003aa-7bff-0310-803a-e67f0ece8222 |
---|---|
date | Wed, 13 Oct 2010 21:50:43 +0000 |
parents | c0c3f64bfc2d |
children | 2851e232a113 |
comparison
equal
deleted
inserted
replaced
646:07b1cf8e92b5 | 647:f2b3512d0e60 |
---|---|
24 from fife import fife | 24 from fife import fife |
25 from scripts.ships.shipbase import * | 25 from scripts.ships.shipbase import * |
26 from scripts.common.baseobject import * | 26 from scripts.common.baseobject import * |
27 from fife.fife import FloatRect as Rect | 27 from fife.fife import FloatRect as Rect |
28 from scripts.weapons import * | 28 from scripts.weapons import * |
29 from fife.extensions import fife_timer | |
29 | 30 |
30 | 31 |
31 class EnemyActionListener(ShipActionListener): | 32 class EnemyActionListener(ShipActionListener): |
32 def __init__(self, ship): | 33 def __init__(self, ship): |
33 super(EnemyActionListener, self).__init__(ship) | 34 super(EnemyActionListener, self).__init__(ship) |
42 | 43 |
43 def onInstanceActionFinished(self, instance, action): | 44 def onInstanceActionFinished(self, instance, action): |
44 super(BossActionListener, self).onInstanceActionFinished(instance, action) | 45 super(BossActionListener, self).onInstanceActionFinished(instance, action) |
45 | 46 |
46 if action.getId() == 'explode': | 47 if action.getId() == 'explode': |
47 self._ship.endLevel() | 48 self.delayed = fife_timer.delayCall(1000,self._ship.endLevel()) |
48 | 49 |
49 | 50 |
50 class Saucer1(Ship): | 51 class Saucer1(Ship): |
51 def __init__(self, scene, name, instance, findInstance=True): | 52 def __init__(self, scene, name, instance, findInstance=True): |
52 super(Saucer1, self).__init__(scene, name, findInstance) | 53 super(Saucer1, self).__init__(scene, name, findInstance) |