home *** CD-ROM | disk | FTP | other *** search
/ GameStar Special 2004 August / GSSH0804.iso / Geschicklichkeit / Enigma / Enigma-081.exe / data / levels / duffy32.lua < prev    next >
Text File  |  2003-08-27  |  4KB  |  144 lines

  1. levelw=80
  2. levelh=20
  3.  
  4. create_world( levelw, levelh)
  5.  
  6. fill_floor("fl-leaves", 0,0,levelw,levelh)
  7.  
  8. function renderLine( line, pattern)
  9.     for i=1, strlen(pattern) do
  10.         local c = strsub( pattern, i, i)
  11.         if c =="#" then
  12.             set_stone( "st-greenbrown", i-1, line)
  13.         elseif c == "o" then
  14.             oxyd( i-1, line)
  15.                 elseif c == "!" then
  16.             abyss(i-1,line)
  17. --            fill_floor("fl-water", i-1,line, 1,1)
  18.         elseif c=="z" then
  19.             set_actor("ac-blackball", i-.5,line+.5, {player=0})
  20.             set_item("it-spring1",i-1,line)
  21. elseif c=="w" then
  22. set_actor("ac-whiteball-small", i-.5,line+.5, {player=0, mouseforce=1})
  23.         elseif c=="+" then
  24.            set_stone( "st-wood",i-1,line)
  25.         elseif c == "s" then
  26.             set_stone("st-stoneimpulse",i-1,line)
  27.         elseif c == "S" then
  28.             set_stone("st-stoneimpulse-hollow",i-1,line)
  29.         elseif c=="=" then
  30.     fill_floor("fl-space", i-1,line, 1,1)
  31.         elseif c=="M" then
  32. set_item( "it-magnet",i-1 ,line , {name="magnet1"})
  33.         elseif c=="N" then
  34. set_item( "it-magnet",i-1 ,line , {name="magnet2"})
  35.         elseif c=="$" then
  36.            set_item( "it-hollow", i-1,line, {name="h1"})
  37.         elseif c=="%" then
  38.            set_item( "it-hollow", i-1,line, {name="h2"})
  39.         elseif c=="^" then
  40.            set_item( "it-hollow", i-1,line, {name="h3"})
  41.         elseif c=="&" then
  42.            set_item( "it-hollow", i-1,line, {name="h4"})
  43.         elseif c=="*" then
  44.            set_item( "it-hollow", i-1,line, {name="h5"})
  45.         elseif c=="Q" then
  46.            set_item( "it-hollow", i-1,line, {name="h6"})
  47.         elseif c=="E" then
  48.            set_item( "it-hollow", i-1,line, {name="h7"})
  49.         elseif c=="R" then
  50.            set_item( "it-hollow", i-1,line, {name="h8"})
  51.         elseif c=="4" then
  52.             set_stone("st-switch", i-1,line, {action="callback",target="hh1"})
  53.         elseif c=="5" then
  54.             set_stone("st-switch", i-1,line, {action="callback",target="hh2"})
  55.         elseif c=="6" then
  56.             set_stone("st-switch", i-1,line, {action="callback",target="hh3"})
  57.         elseif c=="7" then
  58.             set_stone("st-switch", i-1,line, {action="callback",target="hh4"})
  59.         elseif c=="8" then
  60.             set_stone("st-switch", i-1,line, {action="callback",target="hh5"})
  61.         elseif c=="q" then
  62.             set_stone("st-switch", i-1,line, {action="callback",target="hh6"})
  63.         elseif c=="e" then
  64.             set_stone("st-switch", i-1,line, {action="callback",target="hh7"})
  65.         elseif c=="r" then
  66.             set_stone("st-switch", i-1,line, {action="callback",target="hh8"})
  67.     end
  68.     end    
  69. end
  70. -- Floor:  " "
  71. -- Border: "#"
  72. -- Oxyd:   "o"
  73.  
  74. renderLine(00,"!!!!!!!!!!!!!!!!!!!!")
  75. renderLine(01,"####4####!!####e####")
  76. renderLine(02,"#R     *#!!#&     $#")
  77. renderLine(03,"#       #!!#       #")
  78. renderLine(04,"#       #!!#       #")
  79. renderLine(05,"#   w   #!!#   w   #")
  80. renderLine(06,"7  wMw  5!!q  wNw  r")
  81. renderLine(07,"#   w   #!!#   w   #")
  82. renderLine(08,"#       #!!#       #")
  83. renderLine(09,"#       #!!#       #")
  84. renderLine(10,"#E     Q#!!#^     %#")
  85. renderLine(11,"####6####!!####8####")
  86. renderLine(12,"!!!!!!!!!!!!!!!!!!!!")
  87.  
  88. oxyd_shuffle()
  89.  
  90. h1=enigma.GetNamedObject("h1")
  91. h2=enigma.GetNamedObject("h2")
  92. h3=enigma.GetNamedObject("h3")
  93. h4=enigma.GetNamedObject("h4")
  94. h5=enigma.GetNamedObject("h5")
  95. h6=enigma.GetNamedObject("h6")
  96. h7=enigma.GetNamedObject("h7")
  97. h8=enigma.GetNamedObject("h8")
  98.  
  99. magnet1=enigma.GetNamedObject("magnet1")
  100. magnet2=enigma.GetNamedObject("magnet2")
  101.  
  102. enigma.SendMessage(magnet1, "on", nil)
  103. enigma.SendMessage(magnet2, "on", nil)
  104.  
  105. enigma.SendMessage(h1, "trigger", nil)
  106. enigma.SendMessage(h2, "trigger", nil)
  107. enigma.SendMessage(h3, "trigger", nil)
  108. enigma.SendMessage(h4, "trigger", nil)
  109. enigma.SendMessage(h5, "trigger", nil)
  110. enigma.SendMessage(h6, "trigger", nil)
  111. enigma.SendMessage(h7, "trigger", nil)
  112. enigma.SendMessage(h8, "trigger", nil)
  113.  
  114. function hh1()
  115. enigma.SendMessage(h1, "trigger", nil)
  116. end
  117.  
  118. function hh2()
  119. enigma.SendMessage(h2, "trigger", nil)
  120. end
  121.  
  122. function hh3()
  123. enigma.SendMessage(h3, "trigger", nil)
  124. end
  125.  
  126. function hh4()
  127. enigma.SendMessage(h4, "trigger", nil)
  128. end
  129.  
  130. function hh5()
  131. enigma.SendMessage(h5, "trigger", nil)
  132. end
  133.  
  134. function hh6()
  135. enigma.SendMessage(h6, "trigger", nil)
  136. end
  137.  
  138. function hh7()
  139. enigma.SendMessage(h7, "trigger", nil)
  140. end
  141.  
  142. function hh8()
  143. enigma.SendMessage(h8, "trigger", nil)
  144. end