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

  1. -- A level for Enigma
  2. -- Name:        Mirror cabinet
  3. -- Filename:    ralf13.lua
  4. -- Copyright:     (C) Jun 2003 Ralf Westram
  5. -- Contact:     amgine@reallysoft.de
  6. -- License:     GPL v2.0 or above
  7.  
  8. dofile(enigma.FindDataFile("levels/ralf.lua"))
  9.  
  10. --debug_mode()
  11.  
  12. level={
  13.    "####################",
  14.    "#  xxxx #r##r#rr#r##",
  15.    "#       r/  / /  /r#",
  16.    "#       @ ll#l#ll ##",
  17.    "#o      @ l % % l ##",
  18.    "o#      @/l%r#r%l/#.",
  19.    "#O    a @ l ### l r#",
  20.    "o#      @/l%r#r%l/#.",
  21.    "#o      @ l % % l ##",
  22.    "#       @ ll#l#ll ##",
  23.    "#       r/  / /  /r#",
  24.    "#  xxxx #r##r#r##r##",
  25.    "####################",
  26. }
  27.  
  28. mirrors=0
  29. function named_mirror(x,y)
  30.    mirrors=mirrors+1
  31.    set_stone("st-mirror-p\\m",x,y,{name="mirr"..mirrors})
  32. end
  33.  
  34. switches=0
  35. function mirror_switch(x,y)
  36.    switches=switches+1
  37.    local funcn = "swit_"..switches
  38.     dostring(funcn.." = function() switch("..switches..") end")
  39.    set_stone("st-switch",x,y,{action="callback",target=funcn});
  40. end
  41.  
  42. function switch(num)
  43.    enigma.SendMessage(enigma.GetNamedObject("mirr"..num), "turn", 0)
  44. end
  45.  
  46. cells={}
  47.  
  48. cells["!"] = cell{floor="fl-space"}
  49. cells[" "] = cell{floor="fl-black"}
  50. cells["#"] = cell{parent=cells[" "],stone="st-glass"}
  51. cells["@"] = cell{parent=cells[" "],stone="st-grate1"}
  52.  
  53. cells["/"] = cell{parent=cells[" "],stone="st-mirror-p/m"}
  54. cells["%"] = cell{parent={cells[" "],named_mirror}}
  55. cells["x"] = cell{parent={cells[" "],mirror_switch}}
  56.  
  57. cells["a"] = cell{parent=cells[" "],actor={"ac-whiteball", {player=0, controllers=1}}}
  58. cells["o"] = cell{oxyd}
  59. cells["."] = cell{parent=cells[" "],stone={"st-laser-w", {on=1}}}
  60. cells["O"] = cell{parent=cells[" "],stone="st-fakeoxyd"}
  61.  
  62. cells["l"] = cell{parent=cells[" "],stone="st-rotator-left"}
  63. cells["r"] = cell{parent=cells[" "],stone="st-rotator-right"}
  64.  
  65. rs_create_world(level,cells)
  66.