home *** CD-ROM | disk | FTP | other *** search
/ GameStar Special 2004 August / GSSH0804.iso / Geschicklichkeit / Enigma / Enigma-081.exe / data / levels / siegfried87.lua < prev    next >
Text File  |  2003-04-22  |  3KB  |  99 lines

  1. --Siegfried Fennig 23.04.2003 Rev.0
  2.  
  3. levelw = 20
  4. levelh = 13
  5.  
  6. create_world(levelw, levelh)
  7. enigma.ConserveLevel = FALSE
  8. oxyd_default_flavor = "b"
  9. fill_floor("fl-gray", 0, 0, level_width, level_height)
  10.  
  11. function renderLine( line, pattern)
  12.     for i=1, strlen(pattern) do
  13.       local c = strsub( pattern, i, i)
  14.       if c =="t" then
  15.          set_stone("st-turnstile",i-1,line)
  16.       elseif c == "n" then
  17.          set_stone("st-turnstile-n",i-1,line)
  18.       elseif c == "s" then
  19.          set_stone("st-turnstile-s",i-1,line)
  20.       elseif c == "e" then
  21.          set_stone("st-turnstile-e",i-1,line)
  22.       elseif c == "w" then
  23.          set_stone("st-turnstile-w",i-1,line)
  24.       elseif c == "r" then
  25.          set_stone("st-rock6",i-1,line)
  26.       elseif c == "X" then
  27.          set_stone("st-oneway_black",i-1,line, {orientation=enigma.EAST})
  28.       elseif c == "x" then
  29.          set_stone("st-oneway_white",i-1,line, {orientation=enigma.EAST})
  30.       elseif c == "g" then
  31.          set_stone("st-glass1",i-1,line)
  32.       elseif c == "Y" then
  33.          set_stone("st-switch_black",i-1,line, {action="callback", target="callback1"})
  34.       elseif c == "y" then
  35.          set_stone("st-switch_white",i-1,line, {action="callback", target="callback2"})
  36.       elseif c == "L" then
  37.          set_attrib(laser(i-1,line, FALSE, EAST), "name", "laser")
  38.       elseif c == "m" then
  39.          mirrorp(i-1,line,0,1,2)
  40.       elseif c == "M" then
  41.          mirrorp(i-1,line,0,0,4)
  42.       elseif c == "o" then
  43.          oxyd( i-1, line)
  44.       elseif c == "a" then
  45.          set_actor("ac-blackball", i-.5,line+.5, {player=0})
  46.          set_item("it-yinyang", i-1, line+.5)
  47.       elseif c == "b" then
  48.          set_actor("ac-whiteball", i-.5,line+.5, {player=1})
  49.          set_item("it-yinyang", i-1, line+.5)
  50.       elseif c == "d" then
  51.          document(i-1,line,"Nothing can stop us!")
  52.         end
  53.     end
  54. end
  55. --              01234567890123456789
  56. renderLine(00, "rrrrrrrrrrrrrrrrrrrr")
  57. renderLine(01, "rggggggggggggggrggrr")
  58. renderLine(02, "og  n  n  n  n g  mr")
  59. renderLine(03, "rg  tewtewtewt ro  r")
  60. renderLine(04, "rg       n   sbX   r")
  61. renderLine(05, "rgwtewt wt wte rY  r")
  62. renderLine(06, "og s  sn  n  n gd mr")
  63. renderLine(07, "rg  tewtewte tery  r")
  64. renderLine(08, "rg  s          x   r")
  65. renderLine(09, "rgwtewt wt wtear   r")
  66. renderLine(10, "og s  s  s  s  g  mr")
  67. renderLine(11, "rggggggggggggggLggMr")
  68. renderLine(12, "rrrrrrrrrrrrrrrrrrrr")
  69. --              01234567890123456789
  70.  
  71. switch1 = 0
  72. switch2 = 0
  73.  
  74. function switchaction()
  75.     lasera=enigma.GetNamedObject("laser")
  76.     if switch1 == 1 and switch2 == 1 then
  77.         enigma.SendMessage(lasera, "on", nil)
  78.     end
  79.     if switch1 == 0 and switch2 == 1 then
  80.         enigma.SendMessage(lasera, "off", nil)
  81.     end
  82.     if switch1 == 1 and switch2 == 0 then
  83.         enigma.SendMessage(lasera, "off", nil)
  84.     end
  85.     if switch1 == 0 and switch2 == 0 then
  86.         enigma.SendMessage(lasera, "off", nil)
  87.     end
  88. end
  89.  
  90. function callback1 (ison)
  91.      switch1=ison
  92.      switchaction()
  93. end
  94.  
  95. function callback2 (ison)
  96.      switch2=ison
  97.      switchaction()
  98. end
  99.