NOGDUS $1670.00 has been donated to NOGDUS!
June 23, 2017, 08:50:17 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: TJWX XML File Format  (Read 2759 times)
0 Members and 1 Guest are viewing this topic.
Richard Marks
Administrator
Offline Offline

Respect: 3425
« on: May 07, 2010, 10:08:54 PM »

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>
Logged

RedSlash
Offline Offline

Respect: 10
« Reply #1 on: May 08, 2010, 11:13:12 AM »

XML....  Uuggh.
Logged
kingthomas
Offline Offline

Respect: 10
« Reply #2 on: May 08, 2010, 11:22:09 AM »

XML is easy to parse in say C#. Are you using C#?
Logged
Richard Marks
Administrator
Offline Offline

Respect: 3425
« Reply #3 on: May 08, 2010, 08:25:03 PM »

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.
Logged

Tags:
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines
.: Theme by Richard Marks :.
Valid XHTML 1.0! Valid CSS!