Reference:FIFE:Minimal:Loading a map and scrolling it around

Now we need to add a map. There are two extra resources we need here, a map file and some graphic images. To keep things as simple as possible, my map uses only one ground texture, but we'll need to create some directory structure. Use whatever tool you want to create a directory structure like this:

fife/clients/pdemo/objects/ground/sands/01/

Thats a zero, not an O in the last name. Also, remember that pdemo was the name of the folder that we created in the previous article. Now copy all the files in

fife/clients/rio_de_hola/objects/ground/sands/01/

to our folder. that handles all the graphics we need for this part. Next we neep a map file. I created one using the map editor (instructions here), or you can just use [[Media:Example.ogg]] (you'll obviously have to uncompress to the original XML as this wiki does not allow me to upload the original). Be aware that if you create your own, you check the resulting XML file to check all of the paths are correct and any extra files you may have used are in the pdemo folder. However you do it, put the map.xml file in the pdemo folder. Now we can turn to editing the code in run.py. Firstly, under line 15 - from basicapplication import ApplicationBase - add this code

from loaders import loadMapFile

The next piece of code we need to change is in the PDemo class, to load the map and make it viewable. Make the __init__ look like this:

def __init__(self): super(PDemo,self).__init__ # load our map please self.map=loadMapFile("map.xml",self.engine) # and make sure we can see it		self.view = self.engine.getView self.view.resetRenderers self.listener=ApplicationListener(self.engine)

Save, and again execute run.py. You should see our map on the screen.