I spent most of my time this week working on editor improvements, and more two-character support. One of my first steps was to pull code out of the Player class into unique classes for each of the player characters. As a result, only one of the two characters can use a grappling hook, as intended. Next, I need to start building the other character’s special ability
The editor work mostly went into loading art assets and properly handling levels with missing assets, since i’ve been getting more tiles from my artist of varying sizes and shapes. I ended up building a simple XML-based file format for describing tilesets, based on my serialization framework, so that I can easily point the engine at multiple textures to pull tiles from.
It works pretty well, despite only being a couple hundred lines of code, and can easily be adapted to work with the XNA content pipeline, so it’s likely I’ll stick with it. I’m considering adapting the approach to also work for character sprites, since right now I have to manually tag sprite frames with specially-colored pixels in an image editor, which is extremely awkward and easy to get wrong. Here’s a snippet from one of my tilesets:
<TileStrip key="7" typeId="1">
<Id>prison_column_ornate_{index}</Id>
<Filename>prison_columns.png</Filename>
<TileSize width="32" height="208" />
<Border left="0" top="0" right="384" bottom="0" />
</TileStrip>
<TileStrip key="8" typeId="1">
<Id>prison_column_wood_{index}</Id>
<Filename>prison_columns.png</Filename>
<TileSize width="24" height="208" />
<Border left="100" top="0" right="292" bottom="0" />
<Margin left="0" top="0" right="8" bottom="0" />
</TileStrip>
Simple enough syntax to be easy to write by hand in a text editor, but also not too difficult to load at runtime. I’m pretty happy with it.
One of the challenges in making use of the new art assets is getting all my tiles to line up properly. They have a large variety of sizes, so the algorithm I’m currently using to select tile positions isn’t a very good fit for my needs. Right now I’ve been having to make minor adjustments to my tile positions after I place them, but in the long run I’m going to want to come up with a tile placement technique that works well for tiles of all sizes.


