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

  1. levelw=50
  2. levelh=30
  3.  
  4. create_world( levelw, levelh)
  5.  
  6. fill_floor("fl-metal", 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=="w" then
  16.             set_actor("ac-whiteball-small", i-.5,line+.5, {player=0, mouseforce=1})
  17.         elseif c=="H" then
  18.            hollow(i-1,line)
  19.     elseif c=="h" then
  20.            set_item("it-hill",i-1,line)
  21.         elseif c == "d" then --1-d
  22.             set_floor("fl-gradient",  i-1,  line, {type=1})
  23.         elseif c == "u" then --2-u
  24.             set_floor("fl-gradient",  i-1,  line, {type=2})
  25.         elseif c == "r" then --3-r
  26.             set_floor("fl-gradient",  i-1,  line, {type=3})
  27.         elseif c == "l" then --4-l
  28.             set_floor("fl-gradient",  i-1,  line, {type=4})
  29.         elseif c == "1" then --ur
  30.             set_floor("fl-gradient",  i-1,  line, {type=11})
  31.         elseif c == "3" then --dl
  32.             set_floor("fl-gradient",  i-1,  line, {type=9})
  33.         elseif c == "7" then --dr
  34.             set_floor("fl-gradient",  i-1,  line, {type=12})
  35.         elseif c == "9" then --ul
  36.             set_floor("fl-gradient",  i-1,  line, {type=10})
  37.  
  38.         elseif c == "a" then
  39.            set_stone("st-switch",i-1,line,{target="doora",action="openclose"})
  40.         elseif c == "b" then
  41.            set_stone("st-switch",i-1,line,{target="doorb",action="openclose"})
  42.         elseif c == "c" then
  43.            set_stone("st-switch",i-1,line,{target="doorc",action="openclose"})
  44.         elseif c == "e" then
  45.            set_stone("st-switch",i-1,line,{target="doord",action="openclose"})
  46.         elseif c=="A" then
  47.            set_stone("st-door_b",i-1,line,{name="doora"})
  48.             set_floor("fl-gradient",  i-1,  line, {type=3})
  49.         elseif c=="B" then
  50.            set_stone("st-door_b",i-1,line,{name="doorb"})
  51.             set_floor("fl-gradient",  i-1,  line, {type=3})
  52.         elseif c=="C" then
  53.            set_stone("st-door_b",i-1,line,{name="doorc"})
  54.             set_floor("fl-gradient",  i-1,  line, {type=4})
  55.         elseif c=="D" then
  56.            set_stone("st-door_b",i-1,line,{name="doord"})
  57.             set_floor("fl-gradient",  i-1,  line, {type=4})
  58. end
  59.     end    
  60. end
  61.  
  62. -- Floor:  " "
  63. -- Border: "#"
  64. -- Oxyd:   "o"
  65.  
  66. renderLine(00,"########ba##########")
  67. renderLine(01,"#3llllllClH#3lllll1#")
  68. renderLine(02,"#3llllllDlH#d#####u#")
  69. renderLine(03,"#d##########d#3l1#u#")
  70. renderLine(04,"#d#3llllllll7#d#u#u#")
  71. renderLine(05,"#d#d##########d#u#u#")
  72. renderLine(06,"#d#d#3rrwwwwll7#u#u#")
  73. renderLine(07,"#d#d#u##########u#u#")
  74. renderLine(08,"#d#d#u#3rrrrrrrr7#u#")
  75. renderLine(09,"#d#9r7#u##########u#")
  76. renderLine(10,"#d#####u#HrBrrrrrr7#")
  77. renderLine(11,"#9rrrrr7#HrArrrrrr7#")
  78. renderLine(12,"##########ce########")
  79.  
  80. doora=enigma.GetNamedObject("doora")
  81. doorb=enigma.GetNamedObject("doorb")
  82. doorc=enigma.GetNamedObject("doorc")
  83. doord=enigma.GetNamedObject("doord")
  84.  
  85. enigma.SendMessage(doora,"openclose",nil)
  86. enigma.SendMessage(doorb,"openclose",nil)
  87. enigma.SendMessage(doorc,"openclose",nil)
  88. enigma.SendMessage(doord,"openclose",nil)