January 22, 2019, 04:27:20 PM *
Welcome, Guest. Please login or register.

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

Respect: 3425
Offline Offline

Posts: 1027


« 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
<?xml version="1.0"?>
<tjwx version="1.0">
<!-- 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" />

<!-- 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" />

<!-- 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" />


Respect: 10
Offline Offline

Posts: 50

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

XML....  Uuggh.

Respect: 10
Offline Offline

Posts: 78

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

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

Respect: 3425
Offline Offline

Posts: 1027


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

Pages: [1]   Go Up
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!