XML Level File

This section describes the XML format used for all levels.

Common Content

<level>
  <playground map="level.map">
    <gravity>
      ...
    </gravity>
    <decorations>
      ...
    </decorations>
  </playground>

  <startposition .../>

  <gamecontrol>
    ...
  </gamecontrol>
</level>

Structure of the playground node

map
Define the map file to use for this level.
gravity (opt)
The child nodes of the optional gravity node are used to override the default settings of the gravity field.
decorations
This mandatory node contains all decoration objects, that shall be part of the level.

Structure of the gravity node

The optional gravity node has no properties. The meaning and content of the possible child nodes (which are all optional too) are described in the following subsections.

Global gravity fields

  <global gx="0" gy="0" friction="0"/>

The global node defines the gravity settings for the whole playground. There should be only one global node and it should be given as first node.

gx (opt)
The gravity in x direction (default = 0 ).
gy (opt)
The gravity in y direction (default = 100 ).
vx (opt)
The stream velocity in x direction (default = 0 ).
vy (opt)
The stream velocity in y direction (default = 0 ).
friction (opt)
The friction (default = 50 ).

Relative gravity fields

  <relative x="0" y="19" w="40" h="7" gy="-50" vx="70"/>

The relative node represents a local gravity field within a rectangular area, which values will be added to the currently existing gravity settings in this area.

x
The x position of the local gravity field.
y
The y position of the local gravity field.
w
The width of the local gravity field.
h
The height of the local gravity field.
gx (opt)
The gravity in x direction (default = 0 ).
gy (opt)
The gravity in y direction (default = 0 ).
vx (opt)
The stream velocity in x direction (default = 0 ).
vy (opt)
The stream velocity in y direction (default = 0 ).
friction (opt)
The friction (default = 0 ).

Absolute gravity fields

  <absolute x="0" y="7" w="40" h="18" gx="0" gy="50" friction="400"/>

The absolute node represents a local gravity field similar to the relative node. The only difference is, that the absolute node will overwrite the current values of the gravity field inside the given rectangular area.

Properties for the startposition node

The startposition node contains the following properties:

platform or x/y
The start position of the player's ship must be given either via the id of the home platform or via an x and y coordinate.
fuel (opt)
A fuel parameter can be given, defining the filled percentage of the fuel tank (default = 100 ).

Structure of the gamecontrol node

With the content of the gamecontrol node you are able to define different objectives, that must be solved to complete the level. Refer to level scripting for further details.

Level Description and Internationalization

Since the introduction of internationalization support, the description node within the level file is obsolete. Each mission directory now contains a file strings.properties containing the level descriptions in the form:

  name_of_level1.description = Here comes the description
  name_of_level2.description = And here's the description for the next level

Please note that the naming conventions for these property keys requires name_of_levelX to be the file name of the XML level file without the .xml extension.

List of decoration objects

This section describes all decoration objects, that can be used inside the decorations node of the playground . Every object listed here may have a unique id property, which value must lie between 1 and 1023. This id can then be referred in the content of the gamecontrol node to define particular objectives, that must be solved by the player. If the id property is omitted, an id will be generated automatically. That means, such objects are not intented to be refered by gamecontrol .

Laser Barriers

  <barrier x="29" y="18" h="7" on="1" off="4"/>
x
The x position of the barrier.
y
The y position of the barrier.
visible (opt)
Indicates if the barrier shall be visible on level startup (default = true ).
w/h
The width/height of the barrier. Only the w or h property shall exist, implicitly defining a horizontal or vertical alignment.
on (opt)
The time in seconds, the barrier is activated.
off (opt)
The time in seconds, the barrier is deactivated.
delay (opt)
The initial delay time in seconds, before the barrier is activated.
activated (opt)
If given, the properties on , off and delay are ignored and the given bool value indicates, if the barrier is activated or deactivated. This property only makes sense together with level scripting , where barriers can then be turned on/off on particular events.

Black Holes

  <blackhole x="17" y="16"/>
x
The x position of the black hole.
y
The y position of the black hole.
gavity (opt)
The gravity of the black hole (default = 2000 ).

Crates

  <crate type="small" x="5" y="10"/>
type
The type of the crate:
small, medium, or big
Types for crates to be rescued.
bonus
When picked up, add bonus points to the score.
fuel
When picked up, refill the player's fuel.
double
When picked up, the current weapon is upgraded with a double shooter.
triple
When picked up, the current weapon is upgraded with a triple shooter.
back
When picked up, the current weapon is upgraded with a back shooter.
laser
When picked up, the ship's weapon is replaced with a laser gun.
x
The x position of the crate.
y
The y position of the crate.
visible (opt)
Indicates if the crate is visible on level startup (default = true ).
value (opt)
The bonus score, only for bonus crates (default = 1 ).
fuel (opt)
The amount of fuel in percent to add, only for fuel crates (default = 25 ).

You have to keep sure, that all defined crates lie on a platform. Otherwise, the player won't be able to pick them up.

Particle Fountains

  <fountain orientation="left" x="1" y="21" speed="160" lifetime="3"/>
orientation
The orientation of the fountain (top , bottom , left , or right ).
x
The x position of the fountain.
y
The y position of the fountain.
visible (opt)
Indicates if the fountain shall be visible on level startup (default = true ).
on (opt)
The time in seconds, the fountain is activated.
off (opt)
The time in seconds, the fountain is deactivated.
delay (opt)
The initial delay time in seconds, before the fountain is activated.
speed (opt)
The initial particle speed (default = 40 ).
lifetime (opt)
The particle lifetime in seconds (default = 1 ).
scatter (opt)
The particle scatter factor (default = 20 ).

Grinders

  <grinder>
    <waypoint x="184" y="32"/>
    <waypoint x="184" y="200"/>
    ...
  </grinder>
velocity (opt)
The velocity of the grinder in pixels per second (default = 100 ).

Each grinder must contain at least two waypoint nodes. The first waypoint is used as initial position. Each waypoint must contain the following properties:

x
The x position of the waypoint.
y
The y position of the waypoint.
visible (opt)
Indicates if the grinder shall be visible on level startup (default = true ).

Magnets

  <magnet orientation="bottom" x="14" y="11" w="12" distance="10"/>
orientation
The orientation of the magnet (top , bottom , left , or right ).
x
The x position of the magnet.
y
The y position of the magnet.
w/h
The width/height of the magnet. Depending on the orientation of the magnet, only the w or h property shall exist.
on (opt)
The time in seconds, the magnet is activated.
off (opt)
The time in seconds, the magnet is deactivated.
delay (opt)
The initial delay time in seconds, before the magnet is activated.
activated (opt)
If given, the properties on , off and delay are ignored and the given bool value indicates if the magnet is activated or deactivated. This property only makes sense together with level scripting , where magnets can then be turned on/off on particular events.
strength (opt)
The strength of the magnetic field (default = 100 ).
distance (opt)
The distance of the field (default = 5 ).

Mortars

  <mortar orientation="bottom" x="15" y="23">
    <barrel type="smart" warhead="starburst" delay="12"/>
    ...
  </mortar>
orientation
The orientation of the mortar (top , bottom , left , or right ).
x
The x position of the mortar.
y
The y position of the mortar.
visible (opt)
Indicates if the mortar shall be visible on level startup (default = true ).
hitpoints (opt)
The number of shots needed to destroy this mortar (default = 10 ).

Each mortar must contain at least one barrel . Each barrel contains the following properties:

type
The type of the barrel:
fixed
Always shoot to a fixed angle. The angle property is mandatory here.
random
Fire to a random angle.
smart
Fire directly to the player's ship.
warhead
The type of warhead for the grenades:
none
After the exploder delay, the grenade will explode without creating any projectiles.
starburst
After the exploder delay, the grenade will explode, unleashing several projectiles flying in all directions.
angle (opt)
The relative angle to shoot for fixed barrels (default = 0 ).
speed (opt)
The grenade speed (default = 200 ).
delay (opt)
The delay between two shots in tenth of a second (default = 20 ).
exploderdelay (opt)
The delay after a grenade will explode in tenth of a second (default = 10 ).

Platforms

  <platform id="2" x="31" y="23" w="7" left="yellow" right="yellow"/>
x
The x position of the platform.
y
The y position of the platform.
w
The width of the platform.
left (opt)
The type of the left edge (red , yellow , green , cyan , blue , magenta , fuel , or a number between 0 and 9 ). If omitted, no edge will be drawn on the left side.
right (opt)
The type of the right edge (red , yellow , green , cyan , blue , magenta , fuel , or a number between 0 and 9 ). If omitted, no edge will be drawn on the right side.
fuel (opt)
If true , the platform is a fuel platform. If omitted, a default value of false is used.

If the fuel property is set to true or the right or left property is set to fuel , the platform is declared as fuel platform. If the player's ship lands on it, it's fuel will be refilled.

SAM Batteries

  <sam orientation="bottom" x="14" y="24" delay="3" heading="smart" warhead="normal"/>
orientation
The orientation of the SAM battery (top , bottom , left , or right ).
x
The x position of the SAM battery.
y
The y position of the SAM battery.
visible (opt)
Indicates if the SAM battery shall be visible on level startup (default = true ).
hitpoints (opt)
The number of shots needed to destroy this SAM battery (default = 10 ).
delay (opt)
The time between two missile launches in seconds (default = 5 ).
fuel (opt)
The fuel for each missile in seconds (default = 5 ).
heading
The type of heading for the missiles:
direct
The missile always heads directly to the player's ship.
smart
Same as direct, but additionally the missile tries to compensate the effect of gravity.
warhead
The type of warhead for the missiles:
normal
The missile will explode only if it hits something.
coneburst
The missile will explode near the player's ship, unleashing several projectiles flying within an angle of 90 degrees.
starburst
The missile will explode near the player's ship, unleashing several projectiles flying in all directions.

Switches

  <switch id="30" orientation="top" x="16" y="1"/>
orientation
The orientation of the switch (top , bottom , left , or right ).
x
The x position of the switch.
y
The y position of the switch.
visible (opt)
Indicates if the switch shall be visible on level startup (default = true ).

Switches don't contain any pre-defined internal logic. They are only useful together with level scripting . For this reason, the id property is mandatory for switches.

Tanks

  <tank x="9" y="7" w="17" weapon="laser" type="random"/>
x
The x position of the tank's left margin.
y
The y position of the tank (which keeps constant).
visible (opt)
Indicates if the tank shall be visible on level startup (default = true ).
w
The width of the tank's margin, relative to the left margin.
type
The type of shooting:
random
Fire to a random angle.
smart
Fire directly to the player's ship.
weapon (opt)
The weapon of the tank (default = blaster ):
blaster
A blaster gun.
laser
A laser gun, which is faster and stronger than a blaster.
hitpoints (opt)
The number of shots needed to destroy this tank (default = 10 ).
speed (opt)
The projectile speed (default = 200 ).

Thorns

  <thorn orientation="top" x="8" y="9" h="7"/>
orientation
The orientation of the thorn (top , bottom , left , or right ).
x
The x position of the thorn's base.
y
The y position of the thorn's base.
visible (opt)
Indicates if the thorn shall be visible on level startup (default = true ).
w/h
The width/height, the thorn will rise out of the wall. Depending on the orientation of the thorn, only the w or h property shall exist.
  • Tiles
      <tile x="4" y="6" category="brick" tileId="01"/>
    x
    The x position of the tile.
    y
    The y position of the tile.
    visible (opt)
    Indicates if the tile shall be visible on level startup (default = true ).
    hitpoints (opt)
    The number of shots needed to destroy this tile. If omitted, the tile cannot be destroyed.
    category
    The category name of the tile (see file categories.idx ).
    categoryId
    An alternative to the category attribute defining the hex ID of the tile category.
    tileId
    The tile ID of the given category.

Turrets

  <turret orientation="right" x="18" y="12">
    <barrel .../>
    ...
  </turret>
orientation
The orientation of the turret (top , bottom , left , or right ).
x
The x position of the turret.
y
The y position of the turret.
visible (opt)
Indicates if the turret shall be visible on level startup (default = true ).
type
The type of the turret (tube or dome ).
hitpoints (opt)
The number of shots needed to destroy this turret (default = 10 ).
preset (opt)
A preset for this turret (see below).

Each turret must contain at least one barrel . Each barrel contains the following properties:

weapon (opt)
The weapon of the barrel (default = blaster ):
blaster
A blaster gun.
laser
A laser gun, which is faster and stronger than a blaster.
type
The type of the barrel:
fixed
Always shoot at a fixed angle. The angle property is mandatory here.
sweep
Sweep the angle to shoot. The step property is mandatory here.
random
Fire at a random angle.
smart
Fire directly to the player's ship.
angle (opt)
The relative angle to shoot for fixed barrels (default = 0 ).
step (opt)
The angle step for sweep barrels (default = 0 ).
speed (opt)
The projectile speed (default = 200 for blaster barrels, 300 for laser barrels).
delay (opt)
The delay between two shots in tenth of a second (default = 20 ).

Optionally, the properties and barrels of a turret can be defined to hard-coded values using the preset property. The following values are defined:

mark1
Defines type="tube" and a single barrel with type="fixed" .
mark1b
Defines type="tube" and a single barrel with type="fixed" , speed="250" and delay="15" .
mark1c
Defines type="tube" and a single barrel with type="fixed" , speed="300" and delay="10" .
dome1
Defines type="dome" and a single barrel with type="smart" .
dome1b
Defines type="dome" and a single barrel with type="smart" , speed="250" and delay="15" .
dome1c
Defines type="dome" and a single barrel with type="smart" , speed="300" and delay="10" .