Mercurial > fife-parpg
diff demos/shooter/scripts/scene.py @ 452:f07d779362da
Added different enemy types which behave differently.
author | prock@33b003aa-7bff-0310-803a-e67f0ece8222 |
---|---|
date | Sat, 03 Apr 2010 19:19:33 +0000 |
parents | f463ab431cc0 |
children | cf53848fb187 |
line wrap: on
line diff
--- a/demos/shooter/scripts/scene.py Thu Apr 01 21:14:23 2010 +0000 +++ b/demos/shooter/scripts/scene.py Sat Apr 03 19:19:33 2010 +0000 @@ -24,6 +24,7 @@ from fife import fife from scripts.ships.shipbase import Ship from scripts.ships.player import Player +from scripts.ships.enemies import * from scripts.common.helpers import Rect @@ -73,11 +74,14 @@ objectName = instance.getObject().getId() print objectName - enemy = Ship(self._model, 'enemy', self._layer, False) + if objectName == "saucer1": + enemy = Saucer1(self._model, 'enemy', self._layer, False) + elif objectName == "saucer2": + enemy = Saucer2(self._model, 'enemy', self._layer, False) + else: + enemy = Ship(self._model, 'enemy', self._layer, False) + enemy.instance = instance - enemy.width = 0.075 - enemy.height = 0.075 - enemy.velocity.x = -0.13 enemy.start() loc = instance.getLocation().getExactLayerCoordinates()