Skip to content
This repository has been archived by the owner on Feb 19, 2018. It is now read-only.
Andrés edited this page Mar 18, 2015 · 1 revision

###Overview XML is used to define and store game elements (along with necessary bitmaps or files) as a generic and customizable way to change game elements, to parse xml files, tinyxml2 is used check attributions.

By default, all XML files will be under resources/xml directory, but not necessarily. Most game objects attributes are read from xml files, and is the job of each class to read them

###XML in DCmC XML works by a simple elementattributestext system, each element may contain other elements (like a tree), several attributes and one text maximum

As an example, tower.xml will be used

<Tower Version="0.7.5">
  <Name>Tower 0</Name>
  <Sprite>resources/spr/tower_cartoon.png</Sprite>
  <Cost>50</Cost>
  <Tower_Atk Version="0.7.5">
    <Damage>60</Damage>
    <Range>90</Range>
    <Delay>2</Delay>
    <Speed>5</Speed>
    <Type>Shoot</Type>
    <Sprite>resources/spr/cannonball.png</Sprite>
    <Al_Animation Version="0.7.5" loop="false">
      <Width>64</Width>
      <Height>64</Height>
      <Duration>0.5</Duration>
    <Bitmap_Sheet>resources/spr/explosion.png</Bitmap_Sheet>
    </Al_Animation>
  </Tower_Atk>
</Tower>

The element Tower contains all the elements to define a tower, and only one attribute (Version) that indicates the DCmC version which this tower format is compatible, Tower is only a elements container, and does not contains text

Is easy to see the different elements of the tower (like Name or Cost) that have text to define the values of those tower class attributes

Tower also contains another element, Tower_Atk which, in the same way as tower, a tower_atk is defined (being Tower_Atk another container without text)

Note that all sprites and bitmaps are stored as paths, DCmC will (after reading the xml file) load those files.

DCmC Wiki 0.7.6

Clone this wiki locally