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

  1. levelw=77
  2. levelh=61
  3.  
  4. create_world( levelw, levelh)
  5.  
  6. fill_floor("fl-hay", 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.             set_stone( "st-brownie", i-1, line)
  17.         elseif c == "&" then
  18.             set_stone( "st-brownie", i-1, line)
  19.             hammer(i-1,line)
  20.                 elseif c == "!" then
  21.             abyss(i-1,line)
  22. --            fill_floor("fl-water", i-1,line, 1,1)
  23.         elseif c=="z" then
  24.             set_actor("ac-blackball", i-.5,line+.5, {player=0})
  25.             set_item("it-yinyang", i-1, line+.5)
  26.         elseif c=="y" then
  27.             set_actor("ac-whiteball", i-.5,line+.5, {player=1})
  28.             set_item("it-yinyang", i-1, line+.5)
  29.         elseif c == "g" then
  30.             draw_stones("st-grate1",{i-1,line}, {1,1}, 1)
  31.         elseif c=="+" then
  32.             set_stone( "st-wood", i-1, line)
  33.         elseif c=="W" then
  34.                 fill_floor("fl-water", i-1,line, 1,1)
  35.         elseif c=="d" then
  36.             set_stone("st-oneway", i-1,line, {orientation=enigma.SOUTH})    
  37.         elseif c=="l" then
  38.              set_stone("st-oneway", i-1,line, {orientation=enigma.WEST})
  39.         elseif c=="R" then
  40.              set_stone("st-oneway", i-1,line, {orientation=enigma.EAST})
  41.         elseif c=="u" then
  42.                 set_stone("st-oneway", i-1,line, {orientation=enigma.NORTH})
  43.         elseif c=="L" then
  44.             set_attrib(laser(i-1,line, TRUE, NORTH), "name", "laser")
  45.         elseif c=="M" then
  46.             set_attrib(laser(i-1,line, FALSE, SOUTH), "name", "laser2")
  47.         elseif c=="K" then
  48.             set_stone("st-key_a", i-1,line, {action="openclose", target="door5"})
  49.         elseif c=="k" then
  50.             set_item("it-key_a", i-1,line)
  51.         elseif c=="V" then
  52.             set_stone("st-key_b", i-1,line, {action="openclose", target="door3"})
  53.         elseif c=="v" then
  54.             set_item("it-key_b", i-1,line)
  55.         elseif c=="`" then
  56.             mirrorp(i-1,line,FALSE,TRUE, 2)
  57.         elseif c=="/" then
  58.             mirrorp(i-1,line,FALSE,TRUE, 4)
  59.         elseif c=="f" then    
  60.             set_item("it-floppy", i-1,line)
  61.         elseif c=="h" then
  62.             hammer(i-1,line)
  63.         elseif c=="H" then
  64.             set_stone("st-stone_break", i-1,line)
  65.         elseif c=="i" then
  66.             set_stone("st-invisible", i-1,line)
  67.         elseif c=="Q" then
  68.             set_stone("st-bombs", i-1,line)
  69.         elseif c=="F" then
  70.             set_stone( "st-floppy", i-1,line,{action="onoff",target="laser2"})
  71.         elseif c=="A" then
  72.             doorh( i-1,line, {name="door1"})
  73.         elseif c=="B" then
  74.             doorv( i-1,line, {name="door2"})
  75.         elseif c=="C" then
  76.             doorh( i-1,line, {name="door3"})
  77.         elseif c=="4" then
  78.             doorv( i-1,line, {name="door6"})
  79.         elseif c=="J" then
  80.             doorv( i-1,line, {name="door7"})
  81.         elseif c=="<" then
  82.             doorv( i-1,line, {name="door8"})
  83.          elseif c == "D" then
  84.             set_stone("st-bolder", i-1,line, {direction=SOUTH})
  85.         elseif c == "b" then
  86.             yy1( "black",  i-1, line)
  87.         elseif c == "w" then
  88.             yy1( "white",  i-1, line)
  89.         elseif c == "X" then
  90.                     draw_stones("st-yinyang1", { i-1,line}, {0,1},1)
  91.         elseif c=="P" then
  92.             set_item("it-brush",i-1,line)
  93.         elseif c=="r" then
  94.                 set_stone("st-stone_break", i-1,line)
  95.             fill_floor("fl-ice_001", i-1,line, 1,1)
  96.         elseif c=="p" then
  97.             draw_stones("st-stonebrush", {i-1,line}, {1,0},1)
  98.         elseif c=="s" then
  99.             set_stone("st-stoneimpulse",i-1,line)
  100.         elseif c=="S" then
  101.                 set_stone( "st-stoneimpulse-hollow", i-1,line)
  102.         elseif c == "a" then
  103.             set_item("it-trigger", i-1,line, {action="openclose", target="door1"})
  104.         elseif c == "8" then
  105.                 set_item("it-key_c", i-1,line)
  106.         elseif c == "3" then
  107.             set_item("it-coin", i-1,line,{value=2})
  108.         elseif c=="9" then
  109.             set_stone("st-switch", i-1,line, {action="openclose",target="door2"})
  110.         elseif c=="j" then
  111.             set_stone("st-switch", i-1,line, {action="openclose",target="door7"})
  112.         elseif c=="," then
  113.             set_stone("st-switch", i-1,line, {action="openclose",target="door8"})
  114.         elseif c=="6" then
  115.             set_stone("st-key_c", i-1,line, {action="openclose", target="door4"})
  116.         elseif c=="N" then
  117.             set_stone("st-coinslot", i-1,line, {action="callback", target="funcc"})
  118.         elseif c == "5" then
  119.                        set_stone("st-door_b", i-1,line, {name="door4", type="v"})
  120.         elseif c == "2" then
  121.                         set_stone("st-door_b", i-1,line, {name="door5", type="v"})
  122.         elseif c=="=" then
  123.             fill_floor("fl-space", i-1,line, 1,1)
  124.         elseif c=="m" then
  125.             fill_floor("fl-metal",i-1,line, 1,1)
  126.         elseif c=="c" then
  127.             fill_floor("fl-leaves", i-1,line,1,1)
  128.         elseif c=="n" then
  129.                 fill_floor("fl-sand", i-1,line,1,1)
  130.         elseif c == "$" then
  131.                 mirrorp(i-1,line,TRUE,FALSE, 2)
  132.         elseif c == "%" then
  133.             set_stone( "st-glass", i-1, line)
  134.             fill_floor("fl-water", i-1,line, 1,1)
  135.         elseif c == "^" then
  136.             set_stone( "st-glass", i-1, line)
  137.         elseif c=="G" then
  138.             set_stone( "st-greenbrown", i-1, line)
  139.             fill_floor("fl-space", i-1,line, 1,1)
  140.          end
  141.     end    
  142. end
  143.  
  144. function yy1( color, x, y)
  145.         stone = format( "st-%s4", color)
  146.         set_stone( stone, x, y)
  147. end
  148.  
  149. -- Floor:  " "
  150. -- Border: "#"
  151. -- Oxyd:   "o"
  152.  
  153. renderLine(00,"ssssssssssssss###############################################################")
  154. renderLine(01,"s z                                #                   #                  y #")
  155. renderLine(02,"s ####### ######################## # #u#####b######### #A############ ##### #")
  156. renderLine(03,"s # # # # #nnnnnnn#              # # #     # #   v     #         #        # #")
  157. renderLine(04,"# # # # # #nWWWWWn# ############ # # # ### # #   #########       ######## # #")
  158. renderLine(05,"# # # # # #nWWWWWn# #          # #   w #   # #   *SSSSSSS#    # ###SSSSS# # #")
  159. renderLine(06,"# # # # # #nWWaWWn# # ######## # ##### # ### #   #######S#    #sSSSS # S# # #")
  160. renderLine(07,"# # # # # #nWWWWWn# # #        # WWWW### # # #         #S######      & S# # #")
  161. renderLine(08,"# # #   # #nWWWWWn# # # ##########   #   * # #         #SSSSSSSSSSSSSSSS# # #")
  162. renderLine(09,"# # # # # #nWWWWWn# # #      #   #   ####u## #     ###################### # #")
  163. renderLine(10,"# # # # # #nWWWWWn# # ## ###   # #  +  sskl  #  L  #          B           # #")
  164. renderLine(11,"# # #K# # #nWWWWWn# # #  #Q##### #  +  #sss### ##### ########## ########### #")
  165. renderLine(12,"# # ### # #nWWWWWn# # # ##     # #  ## #######       #          #N          #")
  166. renderLine(13,"# #     # #nn++gnn# # #  #  $    #   +   #   ######### ####################=#")
  167. renderLine(14,"# #####    c++c++c# # ## # ###########    i# i         #==================G=#")
  168. renderLine(15,"#          ccccccc#   #  #ccccccccM#      ## ## ########==================G=#")
  169. renderLine(16,"# #####################CF#cc++++ccc#i# #  i#  # #=========================G=#")
  170. renderLine(17,"# b         g +g         ^cc+cc$c#c# # # # ## # #===mmm======G============G=#")
  171. renderLine(18,"# ########################ccgcc+ccc# # #i#    # #===mmm=====G=====mm===mm=G=#")
  172. renderLine(19,"# #                      #cc++++ccc# # # ## #   #===mmm====G======mm===mm=G=#")
  173. renderLine(20,"# # #################### #nnnnnnnnn#   #    #####==========G==============G=#")
  174. renderLine(21,"# #         #V           #WWWWWWWWW### # ####==============GGGGGG=========G=#")
  175. renderLine(22,"# ######### ##############W#WWWWW%WWW#   #===========mmm===G========mm====G=#")
  176. renderLine(23,"# R   #   #    #95       #$WWW%WWWWWW#####===========mmm===G========mm====G=#")
  177. renderLine(24,"# ### # # #### ####W+sss ##WWW%WWWWWf#    =================G6=============G=#")
  178. renderLine(25,"# #   # #    #  # # ###ss############# ####################################=#")
  179. renderLine(26,"# # ### ####### # #   #                234  X X X #    p   p      p       #=#")
  180. renderLine(27,"# #       #   # # ### # ##################  X X X # pp   p   p pppp ppppp #=#")
  181. renderLine(28,"# #######   # # #   # # #oooooooooooooooo#XXX X X #  pp  pp p     p     p #=#")
  182. renderLine(29,"# l   # # ### # # # # # #rrrrrrrrrrrrrrrr#    X X #p  pppp p  ppp ppp p p #=#")
  183. renderLine(30,"# ### # # #   # # #   # #rrrrrrrrrrrrrrrr#XXXXX X #        pppp p   p p p #=#")
  184. renderLine(31,"# # # #   # ### # ### # #rrrrrrrrrrrrrrrr#      X # p pp pp   p   p ppp p #=#")
  185. renderLine(32,"# # # #####     # # ### #rrrrrrrrrrrrrrrr#XXXXXXX ### #  pp p ppppp     p #=#")
  186. renderLine(33,"# #         ##### # # # #rrrrrrrrrrrrrrrr#          P #p    p  p    ppp p #=#")
  187. renderLine(34,"# ###########           #rrrrrrrrrrrrrrrr##############pppppppppppppp   p #=#")
  188. renderLine(35,"#             ###########rrrrrrrrrrrrrrrr< J   X         p        p p ppp #=#")
  189. renderLine(36,"###############         ##################b#w# X ######p pppppppp p   p   #=#")
  190. renderLine(37,"                                         #,#j#####     p        p ppppp pp#=#")
  191. renderLine(38,"                                         #####         pppppppp p         #=#")
  192. renderLine(39,"                                                              p ppppppppp #=#")
  193. renderLine(40,"                                                              p           #=#")
  194. renderLine(41,"                                                              pppppppppppp#=#")
  195. renderLine(42,"                                                                          #=#")
  196. renderLine(43,"                                                                          #=#")
  197. renderLine(44,"                                                                          #=#")
  198. renderLine(45,"                                                                          #=#")
  199. renderLine(46,"                                                                          #=#")
  200. renderLine(47,"                                                                          #=#")
  201. renderLine(48,"                                                                          #=#")
  202. renderLine(49,"                                                                          #=#")
  203. renderLine(50,"                                                                          #=#")
  204. renderLine(51,"                                                                          #=#")
  205. renderLine(52,"                                                                          #=#")
  206. renderLine(53,"                                                                          #=#")
  207. renderLine(54,"                                                                          #=#")
  208. renderLine(55,"                                                                          #=#")
  209. renderLine(56,"                                                                          #=#")
  210. renderLine(57,"                                                                          #=#")
  211. renderLine(58,"                                                                         ##=#")
  212. renderLine(59,"                                                                         #8=#")
  213. renderLine(60,"                                                                         ####")
  214.  
  215. oxyd_shuffle()
  216.  
  217. set_stone( "st-greenbrown", 27, 22)
  218. set_stone( "st-greenbrown", 29, 24)
  219.  
  220. fill_floor("fl-leaves", 31,17,1,1)
  221. fill_floor("fl-leaves", 33,17,1,1)
  222. fill_floor("fl-leaves", 34,15,1,1)
  223.  
  224. fill_floor("fl-sand", 13,13,1,1)
  225. fill_floor("fl-sand", 14,13,1,1)
  226. fill_floor("fl-sand", 15,13,1,1)
  227.  
  228. fill_floor("fl-water", 27,22, 1,1)
  229. fill_floor("fl-water", 26,23, 1,1)
  230. fill_floor("fl-water", 26,24, 1,1)
  231.  
  232. fill_floor("fl-leaves", 12,14,1,1)
  233. fill_floor("fl-leaves", 13,14,1,1)
  234. fill_floor("fl-leaves", 15,14,1,1)
  235. fill_floor("fl-leaves", 16,14,1,1)
  236.  
  237. fill_floor("fl-leaves", 28,16,1,1)
  238. fill_floor("fl-leaves", 29,16,1,1)
  239. fill_floor("fl-leaves", 30,16,1,1)
  240. fill_floor("fl-leaves", 31,16,1,1)
  241. fill_floor("fl-leaves", 28,19,1,1)
  242. fill_floor("fl-leaves", 29,19,1,1)
  243. fill_floor("fl-leaves", 30,19,1,1)
  244. fill_floor("fl-leaves", 31,19,1,1)
  245. fill_floor("fl-leaves", 28,17,1,1)
  246. fill_floor("fl-leaves", 28,18,1,1)
  247. fill_floor("fl-leaves", 31,17,1,1)
  248. fill_floor("fl-leaves", 31,18,1,1)
  249. fill_floor("fl-space", 74,59, 1,1)
  250. fill_floor("fl-space", 60,24, 1,1)
  251.  
  252. fill_floor("fl-sand", 36,24,1,1)
  253.  
  254. fill_floor("fl-ice_001", 25,28, 1,1)
  255. fill_floor("fl-ice_001", 26,28, 1,1)
  256. fill_floor("fl-ice_001", 27,28, 1,1)
  257. fill_floor("fl-ice_001", 28,28, 1,1)
  258. fill_floor("fl-ice_001", 29,28, 1,1)
  259. fill_floor("fl-ice_001", 30,28, 1,1)
  260. fill_floor("fl-ice_001", 31,28, 1,1)
  261. fill_floor("fl-ice_001", 32,28, 1,1)
  262. fill_floor("fl-ice_001", 33,28, 1,1)
  263. fill_floor("fl-ice_001", 34,28, 1,1)
  264. fill_floor("fl-ice_001", 35,28, 1,1)
  265. fill_floor("fl-ice_001", 36,28, 1,1)
  266. fill_floor("fl-ice_001", 37,28, 1,1)
  267. fill_floor("fl-ice_001", 38,28, 1,1)
  268. fill_floor("fl-ice_001", 39,28, 1,1)
  269. fill_floor("fl-ice_001", 40,28, 1,1)
  270.  
  271. door6=enigma.GetNamedObject("door6")
  272.  
  273. function funcc()
  274.    enigma.SendMessage(door6, "open", nil)
  275. end
  276.  
  277. display.SetFollowMode(display.FOLLOW_SCROLLING)