Chapter 5. Create a custom Arena

An Arena in Granatier consists of two files, the myarena.desktop and the myarena.xml.

The .desktop file contains the metadata like the arena name or the author of the arena and consists of the following entries.

[Arena]
Name=My Arena
Description=This is my first Arena
Type=XML
FileName=myarena.xml
Author=Joe User
AuthorEmail=joe.user@foo.org
      

You can choose whatever name you want, but FileName must be the name of the .xml file.

The .xml file contains the actual arena map.

<?xml version="1.0"?>
<Arena arenaFileVersion="1" rowCount="13" colCount="17">
  <Row>    ==== ====    </Row>
  <Row>  ===+++++++===  </Row>
  <Row>  =+++++_+++++=  </Row>
  <Row> ==+++=_p_=+++== </Row>
  <Row>==++===_-_===++==</Row>
  <Row>=+++=++_-_++=+++=</Row>
  <Row> +++++-- --+++++ </Row>
  <Row>=+++=++_-_++=+++=</Row>
  <Row>==++===_-_===++==</Row>
  <Row> ==+++=_p_=+++== </Row>
  <Row>  =+++++_+++++=  </Row>
  <Row>  ===+++++++===  </Row>
  <Row>    ==== ====    </Row>
</Arena>
      

There is no limit for rowCount and colCount, so you can choose the size of the arena by yourself. The following symbols are used for the arena map.

'=' a wall item
' ' a hole item
'_' a ground item
'+' a block item
'x' will randomly create a block or a ground item
'-' an ice item
'o' a mortar item
'u' an arrow up
'r' an arrow right
'd' an arrow down
'l' an arrow left
'p' a player position