Model

Vikings and some more complicated monsters have their own Model. Model is a set of state-image pairs defined in a XML file. Model files are stored in gfx/models/.

<?xml version="1.0"?>

<model>
  <load_pre>
    <image sym="left">vikings/erik/erik_stand_left.tga</image>
    <image sym="right">vikings/erik/erik_stand_right.tga</image>
  </load_pre>

  <states>
    <state name="onground_standing_left" sym="left"/>

    <state name="onground_knocked-out_left" image="erik_ko_left.png"/>
    <state name="onground_knocked-out_right" image="erik_ko_right.png"/>

    <state name="falling_standing_right" sym="right"/>
    <state name="falling_standing_left" sym="left"/>
  </states>
</model>
      

Section 'load_pre' gives names to images which are used more than once. It spares both your fingers and computer's RAM when playing, because it makes every image loaded just once.

In section 'states' images (by file name - attribute 'image' - or symbolic name given in 'load_pre' - attribute 'sym') are assigned to state strings. State strings are defined in the source code of viking/monster.