Sokoban Clone

 Sokoban level-editor
Sokoban level-editor

I am currently working on a new Flash game, a Sokoban clone. Although this is ‘just another game’, I have taken a different approach in creating content for this game: I’ve used XML and a level-editor, doing this has increased workflow dramatically. The screenshot above was made in the editor while creating a level, which is then to be exported to a Extensible Markup Language (XML) file. The fun of XML is that I can easily expand and extract information about the levels. In XML the level looks like this:

<level>
	<id>21</id>
	<name>4-1</name>
	<player>2,5</player>
	<map>
		20,20,20,20,20,0,0,0,0,0,
		20,21,21,21,20,20,20,0,0,0,
		20,21,21,21,21,21,20,0,0,0,
		20,21,21,21,22,21,20,0,0,0,
		20,20,21,22,21,21,20,0,0,0,
		0,20,21,21,21,21,20,0,0,0,
		0,20,21,21,21,21,20,0,0,0,
		0,20,21,21,20,20,20,0,0,0,
		0,20,20,20,20,0,0,0,0,0,
		0,0,0,0,0,0,0,0,0,0,
	</map>
	<blocks>
		<block>3,5</block>
		<block>4,5</block>
	</blocks>
	<dests>
		<dest>1,2</dest>
		<dest>3,2</dest>
	</dests>
</level>

Because my editor is very simple, I have to manually edit the id and name tag of each level. There is no way of loading a level, I can only create and export them. The editor is only meant to create the levels and not to be used by the public, so it serves it purpose. The implementation of XML was easier than I had expected and I think it would be useful to use for other games such as adventure-games, where I could for example write the dialogue in XML.

Leave a comment

Your email address will not be published. Required fields are marked *