Mercurial > fife-parpg
diff demos/shooter/scripts/ships/enemies.py @ 459:302a69c5141d
Player death is now handled a bit nicer.
Added invulnerability.
Added 3 more enemy types.
Fixed a bug in the collision detection routine that caused some objects not to be updated when a collision is detected.
author | prock@33b003aa-7bff-0310-803a-e67f0ece8222 |
---|---|
date | Fri, 09 Apr 2010 17:35:52 +0000 |
parents | bd7e8f708adf |
children | 5e1d6e40d19d |
line wrap: on
line diff
--- a/demos/shooter/scripts/ships/enemies.py Thu Apr 08 21:26:46 2010 +0000 +++ b/demos/shooter/scripts/ships/enemies.py Fri Apr 09 17:35:52 2010 +0000 @@ -85,4 +85,35 @@ self._time += self._scene.timedelta - super(Saucer2, self).update() \ No newline at end of file + super(Saucer2, self).update() + +class DiagSaucer(Ship): + def __init__(self, scene, name, direction, findInstance=True): + super(DiagSaucer, self).__init__(scene, name, findInstance) + self.width = 0.2 + self.height = 0.2 + + if direction == 0: + self._ythrust = 0.25 + else: + self._ythrust = -0.25 + + self.weapon = Cannon(self._scene, self, 2000) + self.weapon.projectilevelocity = 0.4 + + def update(self): + self.applyThrust(fife.DoublePoint(-0.25,self._ythrust)) + super(DiagSaucer, self).update() + +class Streaker(Ship): + def __init__(self, scene, name, findInstance=True): + super(Streaker, self).__init__(scene, name, findInstance) + + self._maxvelocity = 2.0 + + self.weapon = Cannon(self._scene, self, 2000) + self.weapon.projectilevelocity = 1.0 + + def update(self): + self.applyThrust(fife.DoublePoint(-0.40,0)) + super(Streaker, self).update() \ No newline at end of file