home *** CD-ROM | disk | FTP | other *** search
/ GameStar Special 2004 August / GSSH0804.iso / Geschicklichkeit / Enigma / Enigma-081.exe / data / levels / ss_esp20.lua < prev    next >
Encoding:
Text File  |  2003-09-24  |  2.0 KB  |  65 lines

  1. -- Smutty Smurf 2003
  2. -- ESPRIT #020
  3. -- force against the actors by switching to hill could be stronger!
  4.  
  5. levelw = 20
  6. levelh = 13
  7. create_world(levelw, levelh)
  8.  
  9. fill_floor("fl-wood", 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 ==   "#" then
  15.          set_stone("st-greenbrown",i-1,line)
  16.       elseif c=="H" then
  17.          set_floor("fl-gray",i-1,line)
  18.          hollow(i-1,line)
  19.       elseif c=="1" then
  20.      set_stone("st-switch",i-1,line, {action="callback", target="s1"})
  21.       elseif c=="2" then
  22.      set_stone("st-switch",i-1,line, {action="callback", target="s2"})
  23.       elseif c=="3" then
  24.      set_stone("st-switch",i-1,line, {action="callback", target="s3"})
  25.       elseif c=="4" then
  26.      set_stone("st-switch",i-1,line, {action="callback", target="s4"})    
  27.         end
  28.     end
  29. end
  30. --              01234567890123456789
  31. renderLine(00, "####################")
  32. renderLine(01, "#                  #")
  33. renderLine(02, "#                  #")
  34. renderLine(03, "#                  #")
  35. renderLine(04, "#                  #")  
  36. renderLine(05, "#                  #")
  37. renderLine(06, "#    H1 H2 H3 H4   #")
  38. renderLine(07, "#                  #")
  39. renderLine(08, "#                  #")
  40. renderLine(09, "#                  #")
  41. renderLine(10, "#                  #")
  42. renderLine(11, "#                  #")
  43. renderLine(12, "####################")
  44. --              01234567890123456789
  45.  
  46. local s={0, 0, 0, 0}
  47. function s1 () sx(1) end 
  48. function s2 () sx(2) end 
  49. function s3 () sx(3) end 
  50. function s4 () sx(4) end 
  51.  
  52. function sx(num)
  53.    %s[num] = 1-%s[num]
  54.    if (%s[num] == 1) then 
  55.       set_item("it-hill",3*num+2,6)
  56.    else 
  57.       set_item("it-hollow",3*num+2,6)
  58.    end
  59. end
  60.  
  61. set_actor("ac-whiteball-small", 9.5, 10.5, {player=0, mouseforce=1})
  62. set_actor("ac-whiteball-small",10.5, 10.5, {player=0, mouseforce=1})
  63. set_actor("ac-whiteball-small", 11.5, 10.5, {player=0, mouseforce=1})
  64. set_actor("ac-whiteball-small",8.5, 10.5, {player=0, mouseforce=1})
  65.