<?lua
  include("hudtemplates3.oxo")
?>

<?lua
  include("templates/spaceship_assff.oxt")
?>

<Level
 name         = "Sample"
 description  = "Just a few tests"
>
  <Scene
   ambientlight = "0.5, 0.5, 0.5"
   skybox       = "Orxonox/Starbox"
  >
    <!--SpawnPoint position="0,   0,  100"           spawnclass=SpaceShip pawndesign=spaceshipassff />
    <SpawnPoint position="0,   0, -700" yaw  =180 spawnclass=SpaceShip pawndesign=spaceshipassff />
    <SpawnPoint position="0, 300, -300" pitch=-90 spawnclass=SpaceShip pawndesign=spaceshipassff /-->

    <MovableEntity position="-300,200,-800" velocity="5,0,0" rotationaxis="1,0,0" rotationrate=0>
      <attached>
        <Model position="0,0,0" scale=10 mesh="satellite.mesh" />
        <MovableEntity position="-4,0,0" velocity="0,0,0" rotationaxis="0,0,1" rotationrate=50>
	  <attached>
            <Model position="4,0,0" scale=10 mesh="satellitedish.mesh"/>
          </attached>
	</MovableEntity>
        <ParticleEmitter pitch=-135 roll=30 position="-14, 3.5,-2.5" source="Orxonox/thruster3" lifetime=2.0 loop=1 startdelay=3.0 />
        <ParticleEmitter pitch=135 roll=30 position="-14, 3.5,-9" source="Orxonox/thruster3" lifetime=2.0 loop=1 startdelay=3.0 />
        <ParticleEmitter pitch=-45 roll=30 position="-14,-3.5,-2.5" source="Orxonox/thruster3" lifetime=2.0 loop=1 startdelay=3.0 />
        <ParticleEmitter pitch=45 roll=30 position="-14,-3.5,-9" source="Orxonox/thruster3" lifetime=2.0 loop=1 startdelay=3.0 />
      </attached>
    </MovableEntity>

    <MovableEntity scale=1.5 position="0,0,-300" velocity="0,0,0" rotationaxis="0,1,0" rotationrate=90>
      <events>
        <activity>
          <DistanceTrigger position="0,0,-300" distance=50 target="ControllableEntity" invert=1 />
        </activity>
      </events>
      <attached>
        <Model position="0,0,0" scale=10 mesh="ast1.mesh" />
        <PositionableEntity position="0,0,100">
          <attached>
            <Model position="0,0,0" scale=6 mesh="ast1.mesh" />
            <MovableEntity position="0,0,0" velocity="0,0,0" rotationaxis="0,0,1" rotationrate=500>
              <attached>
                <Model position="0,35,0" scale=2 mesh="ast1.mesh" />
                <Model position="0,-35,0" scale=2 mesh="ast1.mesh" />
                <Model position="35,0,0" scale=2 mesh="ast1.mesh">
                  <attached>
                    <ParticleEmitter position="0,0,0" source="Orxonox/fire3" />
                  </attached>
                </Model>
                <Model position="-35,0,0" scale=2 mesh="ast1.mesh">
                  <attached>
                    <ParticleEmitter position="0,0,0" source="Orxonox/fire3" />
                  </attached>
                </Model>
              </attached>
            </MovableEntity>
          </attached>
        </PositionableEntity>
        <MovableEntity position="0,0,-100" velocity="0,0,0" rotationaxis="0,1,0" rotationrate=200>
          <attached>
            <ParticleEmitter position="0,0,0" source="Orxonox/fire3" />
            <Model position="0,0,0" scale=6 mesh="ast1.mesh" />
            <Model position="0,0,-50" scale=3 mesh="ast1.mesh" />
            <Model position="0,0,50" scale=3 mesh="ast1.mesh" />
          </attached>
        </MovableEntity>
      </attached>
    </MovableEntity>


    <ParticleSpawner position="-500,0,-200" source="Orxonox/BigExplosion1part1" lifetime=3.0 loop=1 />
    <ParticleSpawner position="-500,0,-300" source="Orxonox/BigExplosion1part1" lifetime=3.0 loop=1 />
    <ParticleSpawner position="-500,0,-400" source="Orxonox/BigExplosion1part1" lifetime=3.0 loop=1 />
    <ParticleSpawner position="-500,0,-500" source="Orxonox/BigExplosion1part1" lifetime=2.5 loop=1 />
    <ParticleSpawner position="-500,0,-600" source="Orxonox/BigExplosion1part1" lifetime=2.5 loop=1 />


    <ParticleSpawner position="0,0,100" source="Orxonox/BigExplosion1part3" lifetime=2.0 loop=0 autostart=0>
      <events>
        <spawn>
          <EventTrigger delay=1>
            <events>
              <trigger>
                <SpawnPoint position="0,0,100" spawnclass=SpaceShip pawndesign=spaceshipassff />
              </trigger>
            </events>
          </EventTrigger>
        </spawn>
      </events>
    </ParticleSpawner>


    <ParticleEmitter name=fireright position="200,0,0" source="Orxonox/fire3" active=false>
      <events>
        <activity>
          <DistanceTrigger name=firetrigger1 position="200,0,0" distance=100 target="ControllableEntity" />
        </activity>
      </events>
    </ParticleEmitter>
    <ParticleEmitter name=fireleft position="-200,0,0" source="Orxonox/fire3" active=false>
      <events>
        <activity>
          <DistanceTrigger name=firetrigger2 position="-200,0,0" distance=100 target="ControllableEntity" />
        </activity>
      </events>
    </ParticleEmitter>
    <ParticleEmitter name=firecenter position="0,0,0" source="Orxonox/fire3" active=false>
      <events>
        <activity>
          <EventListener event=firetrigger1 />
          <EventListener event=firetrigger2 />
        </activity>
      </events>
    </ParticleEmitter>


    <EventDispatcher>
      <targets>
        <EventTarget name=fireright />
        <EventTarget name=firecenter />
        <EventTarget name=fireleft />
      </targets>
      <events>
        <activity>
          <DistanceTrigger position="0,0,200" distance=100 target="ControllableEntity" />
        </activity>
      </events>
    </EventDispatcher>


    <Model position="0,50,0" scale=3 mesh="assff.mesh">
      <events>
        <visibility>
          <DistanceTrigger position="0,50,0" distance=50 target="ControllableEntity" invert=1 />
        </visibility>
      </events>
    </Model>


    <Model position="0,0,200" scale=10 mesh="ast2.mesh" shadow=true />
    <!--Model position="0,0,-200" scale=10 mesh="ast1.mesh" shadow=true /-->
    <Model position="0,200,0" scale=10 mesh="ast3.mesh" shadow=true />
    <Model position="0,-200,0" scale=10 mesh="ast4.mesh" shadow=true />
    <Model position="200,0,0" scale=10 mesh="ast5.mesh" shadow=false />
    <Model position="-200,0,0" scale=10 mesh="ast6.mesh" shadow=false />

    <Model position="1000,-200,0" scale3D="1,100,100" mesh="ast1.mesh" />

    <Model position="0, 0,-100" pitch=-90 roll=-90 scale=4 mesh="assff.mesh" />
    <!--Model position="0,100,-100" pitch=-90 roll=-90 scale=4 mesh="pirate.mesh" />
    <Model position="0,300,-100" pitch=-90 roll=-90 scale=4 mesh="spacecruiser.mesh" /-->

  </Scene>
</Level>
