TJWX XML File Format

(1/1)

Richard Marks:
TJWX XML File Format

The Tiny Jumper engine will support both the TJW binary level files and this alternate XML text based format.

*DTD coming soon.

Sample Level File
Code:

<?xml version="1.0"?>
<tjwx version="1.0">
<definitions>
<!-- define a small blue square block type -->
<block width="10" height="10" color="0x0000FF" flags="31" />

<!-- define a medium red square block type -->
<block width="20" height="20" color="0xFF0000" flags="31" />

<!-- define a large green square block type -->
<block width="40" height="40" color="0x00FF00" flags="31" />

<!-- define a grey floor block type -->
<block width="100" height="1" color="0x343434" flags="18" />

<!-- define a wall made of small blue blocks -->
<prefab width="10" height="100">
<blockref id="0" x="0" y="0" />
<blockref id="0" x="0" y="10" />
<blockref id="0" x="0" y="20" />
<blockref id="0" x="0" y="30" />
<blockref id="0" x="0" y="40" />
<blockref id="0" x="0" y="50" />
<blockref id="0" x="0" y="60" />
<blockref id="0" x="0" y="70" />
<blockref id="0" x="0" y="80" />
<blockref id="0" x="0" y="90" />
</prefab>

<!-- define a staircase made of small, medium and large blocks -->
<prefab width="150" height="150">
<blockref id="2" x="30" y="110" />
<blockref id="2" x="70" y="110" />
<blockref id="2" x="110" y="110" />
<blockref id="2" x="70" y="70" />
<blockref id="2" x="110" y="70" />
<blockref id="2" x="110" y="30" />
<blockref id="1" x="10" y="130" />
<blockref id="1" x="50" y="90" />
<blockref id="1" x="90" y="50" />
<blockref id="1" x="130" y="10" />
<blockref id="0" x="0" y="140" />
<blockref id="0" x="20" y="120" />
<blockref id="0" x="40" y="100" />
<blockref id="0" x="60" y="80" />
<blockref id="0" x="80" y="60" />
<blockref id="0" x="100" y="40" />
<blockref id="0" x="120" y="20" />
<blockref id="0" x="140" y="0" />
</prefab>

</definitions>
<worlddata>
<!-- place the left and right walls -->
<prefabref id="0" x="0" y="0" />
<prefabref id="0" x="0" y="100" />
<prefabref id="0" x="790" y="0" />
<prefabref id="0" x="790" y="100" />

<!-- place the floor -->
<blockref id="3" x="0" y="599" />
<blockref id="3" x="100" y="599" />
<blockref id="3" x="200" y="599" />
<blockref id="3" x="300" y="599" />
<blockref id="3" x="400" y="599" />
<blockref id="3" x="500" y="599" />
<blockref id="3" x="600" y="599" />
<blockref id="3" x="700" y="599" />

<!-- place the staircase -->
<prefabref id="1" x="40" y="449" />
</worlddata>
</tjwx>

RedSlash:
XML....  Uuggh.

kingthomas:
XML is easy to parse in say C#. Are you using C#?

Richard Marks:
I'm not using C# actually. Tiny Jumper is C++ (using my ASK framework as the base)

I'm primarily going to be using the binary file format myself, though I figured I'd define an XML version for those crazy people that might want to write something using it.

Navigation

[0] Message Index