XMLGameEngine

XMLGameEngine is a VGDL (video game description language) and an engine for running games completely contained within an XML file.

View the Project on GitHub beefviper/XMLGameEngine

Timers and paths

Timers

<timers>
  <timer>
    <every><random><min>0.3</min><max>1.4</max></random></every>
    <reverse />
  </timer>
  <timer name="fuse">
    <after>3</after>
    <despawn />
  </timer>
</timers>

A <timer> goes off <every> so many seconds, again and again, or once <after> that long, and runs the commands after it.

Time left

A named object timer is also a number of its object: energy.level is the seconds the timer level on energy has left, rounded up (3, 2, 1, then 0).

<text><number>energy.level</number></text>

Paths

<paths>
  <path name="dive">
    <speed>3</speed>
    <step><x>-24</x><y>-24</y><play sound="dive" /></step>
    <step><x>80</x><y>120</y><fire object="bomb" /></step>
    <step><x>-56</x><y>568</y></step>
    <home />
  </path>
</paths>

A <path> is a route written once in the game’s <paths>, flown by any object that <follow>s it.