Mercurial > fife-parpg
comparison 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 |
comparison
equal
deleted
inserted
replaced
458:e77ebf128a74 | 459:302a69c5141d |
---|---|
84 self._time = 0 | 84 self._time = 0 |
85 | 85 |
86 self._time += self._scene.timedelta | 86 self._time += self._scene.timedelta |
87 | 87 |
88 super(Saucer2, self).update() | 88 super(Saucer2, self).update() |
89 | |
90 class DiagSaucer(Ship): | |
91 def __init__(self, scene, name, direction, findInstance=True): | |
92 super(DiagSaucer, self).__init__(scene, name, findInstance) | |
93 self.width = 0.2 | |
94 self.height = 0.2 | |
95 | |
96 if direction == 0: | |
97 self._ythrust = 0.25 | |
98 else: | |
99 self._ythrust = -0.25 | |
100 | |
101 self.weapon = Cannon(self._scene, self, 2000) | |
102 self.weapon.projectilevelocity = 0.4 | |
103 | |
104 def update(self): | |
105 self.applyThrust(fife.DoublePoint(-0.25,self._ythrust)) | |
106 super(DiagSaucer, self).update() | |
107 | |
108 class Streaker(Ship): | |
109 def __init__(self, scene, name, findInstance=True): | |
110 super(Streaker, self).__init__(scene, name, findInstance) | |
111 | |
112 self._maxvelocity = 2.0 | |
113 | |
114 self.weapon = Cannon(self._scene, self, 2000) | |
115 self.weapon.projectilevelocity = 1.0 | |
116 | |
117 def update(self): | |
118 self.applyThrust(fife.DoublePoint(-0.40,0)) | |
119 super(Streaker, self).update() |