<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<el:level xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://enigma-game.org/schema/level/1 level.xsd" xmlns:el="http://enigma-game.org/schema/level/1">
  <el:protected>
    <el:info el:type="level">
      <el:identity el:title="Hurry!" el:subtitle="" el:id="jc01"/>
      <el:version el:score="1" el:release="1" el:revision="0" el:status="released"/>
      <el:author  el:name="Jens-Christian Korth" el:email="" el:homepage=""/>
      <el:copyright>Copyright © year Jens-Christian Korth</el:copyright>
      <el:license el:type="Donated to Enigma under the projects license" el:open="true"/>
      <el:compatibility el:enigma="0.92">
      </el:compatibility>
      <el:modes el:easy="false" el:single="true" el:network="false"/>
      <el:comments>
        <el:code>Lua 5.1 and XML converted by Leveladministrators</el:code>
      </el:comments>
      <el:score el:easy="-" el:difficult="-"/>
    </el:info>
    <el:luamain><![CDATA[
c = 0
inner = 0
total = 0

function sw1()
   if (inner == 0) then
      if (c == 0) then
         SendMessage("door", "open")
         c = 5
         total = total + 1
         if (total == 10) then
            total = 0
            SendMessage("fart", "trigger")
         end
      end
   else
      c = 1
   end
   inner = 0
end

function sw2()
   inner = 1
end

function nextsec()
   if (c > 0) then
      SendMessage("fakeox", "blink")
      c = c - 1
      if (c == 0) then
         SendMessage("door", "close")
      end
   end
end

create_world(20, 13) 
draw_border("st-invisible")
fill_floor("fl-stone")
fill_floor("fl-normal", 13,0,6,level_height)

draw_stones("st-rock1", {12,1}, {0,1}, 11)
draw_stones("st-rock1", {19,1}, {0,1}, 11)
draw_stones("st-rock1", {12,0}, {1,0}, 8)
draw_stones("st-rock1", {12,12}, {1,0}, 8)
set_stone("st-rock1", 11,5)
set_stone("st-rock1", 13,5)
set_stone("st-rock1", 11,7)
set_stone("st-rock1", 13,7)

set_stone("st-door", 12, 6, {name="door", type="v"})
set_floor("fl-gradient", 12, 6, {type=3})

set_item("it-trigger", 11, 6, {action="callback", target="sw1"})
set_item("it-trigger", 13, 6, {action="callback", target="sw2"})

set_stone("st-timer", 12,5, 
          {loop=0, action="callback", target="nextsec", interval=1})
set_stone("st-fart", 17,10, {name="fart"})

oxyd(14,2)
oxyd(17,2)
oxyd(14,10)
oxyd(17,6)
oxyd(2,2)
oxyd(6,2)
oxyd(10,2)
oxyd(6,6)
oxyd(2,10)
oxyd(2,6)
oxyd(6,10)
oxyd(10,10)
oxyd_shuffle() 

set_actor("ac-blackball", 10,6.5)
    ]]></el:luamain>
    <el:i18n>
      <el:string el:key="title">
        <el:english el:translate="false"/>
      </el:string>
    </el:i18n>
  </el:protected>
</el:level>
