# HG changeset patch
# User prock@33b003aa-7bff-0310-803a-e67f0ece8222
# Date 1274194113 0
# Node ID 96c4922c1c242862e4026919a0a1f75669d2693f
# Parent 6614a54463527b527414f6492588f6f9aca0fbfa
Added some imports to the world initialization code. I had to do this because you were not able to use the editor with the shooter demo map files without manually adding the imports to the map file. You do not have to do this now (note the TODO in the comments). I have also hard coded the camera zoom level to ensure the map editors zoom level at the time of saving the map is not used.
diff -r 6614a5446352 -r 96c4922c1c24 demos/shooter/maps/shooter_map1.xml
--- a/demos/shooter/maps/shooter_map1.xml Fri May 14 21:40:56 2010 +0000
+++ b/demos/shooter/maps/shooter_map1.xml Tue May 18 14:48:33 2010 +0000
@@ -5,10 +5,6 @@
-
-
-
-
diff -r 6614a5446352 -r 96c4922c1c24 demos/shooter/scripts/world.py
--- a/demos/shooter/scripts/world.py Fri May 14 21:40:56 2010 +0000
+++ b/demos/shooter/scripts/world.py Tue May 18 14:48:33 2010 +0000
@@ -29,7 +29,7 @@
from fife.extensions.soundmanager import SoundManager
from scripts.common.eventlistenerbase import EventListenerBase
-from fife.extensions.loaders import loadMapFile
+from fife.extensions.loaders import loadMapFile, loadImportFile
from scripts.gui.guis import *
@@ -137,6 +137,14 @@
self._filename = filename
self.reset()
+
+ #specific imports that needed to be added
+ #@todo: you should be able to add file imports via the map editor
+ loadImportFile("objects/projectiles/bullet1/object.xml", self._engine)
+ loadImportFile("objects/projectiles/fireball/object.xml", self._engine)
+ loadImportFile("objects/powerups/cannonspread5/object.xml", self._engine)
+ loadImportFile("objects/powerups/extralife/object.xml", self._engine)
+
self._map = loadMapFile(self._filename, self._engine)
self._scene = Scene(self, self._engine, self._map.getLayer('objects'), self._soundmanager)
@@ -268,6 +276,7 @@
#pass the camera to the scene as the scene controls the cameras position
self._scene.attachCamera(self.cameras['main'])
+ self.cameras['main'].setZoom(1.0)
def resetKeys(self):
self._keystate['UP'] = False