comparison demos/shooter/scripts/scene.py @ 470:3b04e921c93d

Added the fireball projectile. Added a new ship images for the boss. Some enemies now shoot directly at the player.
author prock@33b003aa-7bff-0310-803a-e67f0ece8222
date Wed, 14 Apr 2010 19:15:27 +0000
parents 5994e61cdebd
children 7a79dc2a0592
comparison
equal deleted inserted replaced
469:5994e61cdebd 470:3b04e921c93d
272 272
273 if obj.changedposition: 273 if obj.changedposition:
274 self.moveObjectInScene(obj) 274 self.moveObjectInScene(obj)
275 275
276 if obj != self._player: 276 if obj != self._player:
277 #TODO: enemy should fire weapon in their update function
278 if obj.running:
279 obj.fire(fife.DoublePoint(-1,0))
280
281 if obj.running and obj.boundingbox.intersects(self._player.boundingbox): 277 if obj.running and obj.boundingbox.intersects(self._player.boundingbox):
282 #player touched an enemy. Destroy player and 278 #player touched an enemy. Destroy player and
283 #re-initialize scene 279 #re-initialize scene
284 if not self._player.invulnerable: 280 if not self._player.invulnerable:
285 self.playerHit() 281 self.playerHit()