I thought it might be useful to go over how I wrote the custom level processor, because after following the example in the documentation I still had some questions.
The Level Classes
I already had the classes that make up my level, because I was using them in the level editor. This is the class diagram of the level objects:
As you can see, it’s pretty straightforward.
The classes on the left hold the Farseer collision entity data. I need to update these to add extra information, such as making the collision entities static or dynamic.
The TextureInstance class represents a single texture drawn on the screen. Note that it doesn’t hold the actual texture, just the name of the texture. The textures themselves are stored in the Level class. This is so that I’m not duplicating textures in memory if I need to draw the same image in multiple places.
The Level class just holds collections of the other classes, the Texture2D images, and the height and width of the level.