<?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="Lissajous' Revenge" el:subtitle="" el:id="andreas12"/>
      <el:version el:score="1" el:release="2" el:revision="6" el:status="released"/>
      <el:author  el:name="Andreas Lochmann" el:email="" el:homepage=""/>
      <el:copyright>Copyright © 2005, 2009 Andreas Lochmann</el:copyright>
      <el:license el:type="GPL v2.0 or above" el:open="true"/>
      <el:compatibility el:enigma="1.10">
      </el:compatibility>
      <el:modes el:easy="true" el:single="true" el:network="false"/>
      <el:comments>
      </el:comments>
      <el:score el:easy="00:13" el:difficult="00:22"/>
    </el:info>
    <el:luamain><![CDATA[

wo["ConserveLevel"] = false

ti[" "] = {"fl_aquamarine"}
ti["~"] = {"fl_water"}
ti["."] = {"fl_swamp"}
ti["#"] = {"st_purplegray"}
ti["1"] = {"st_oxyd", flavor = "b", oxydcolor = OXYD_GREEN} .. ti["."]
ti["2"] = {"st_oxyd", flavor = "b", oxydcolor = OXYD_BLUE} .. ti["."]
ti["3"] = {"st_oxyd", flavor = "b", oxydcolor = OXYD_CYAN} .. ti["."]
ti["4"] = {"st_oxyd", flavor = "b", oxydcolor = OXYD_PURPLE} .. ti["."]
ti["T"] = {"st_timer", target = "spin_gravity", interval = 0.1}
ti["@"] = {"ac_marble", 0, 0.5, adhesion = 1}
ti["-"] = cond(wo["IsDifficult"], ti["~"], ti["."])

w, h = wo(ti, " ",
       {"T###################",
        "#~~..............~~#",
        "#~....~~~..~~~....~#",
        "#.....~1-..-2~.....#",
        "#..~~--......--~~..#",
        "#..~4..........3~..#",
        "#..---... @...---..#",
        "#..~3..........4~..#",
        "#..~~--......--~~..#",
        "#.....~2-..-1~.....#",
        "#~....~~~..~~~....~#",
        "#~~..............~~#",
        "####################"})

wo:shuffleOxyd()

-- Stolen from Nat Pryce ("When Gravity Fails"), then adapted for API 2.
angle1 = 90.0
angle2 = 90.0
angle1_delta = 360.0 * 0.1 / 2.0
angle2_delta = 360.0 * 0.1231 / 2.0

function spin_gravity()
    angle1 = math.fmod(angle1 + angle1_delta, 360.0)
    angle2 = math.fmod(angle2 + angle2_delta, 360.0)
    local gravity_x = math.cos(math.rad(angle1)) * 20.0
    local gravity_y = math.sin(math.rad(angle2)) * 20.0
    wo["GlobalForce"] = po(gravity_x, gravity_y)
end

    ]]></el:luamain>
    <el:i18n>
      <el:string el:key="title">
        <el:english el:translate="false"/>
      </el:string>
    </el:i18n>
  </el:protected>
</el:level>
