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

  1. levelw = 39
  2. levelh = 25
  3.  
  4. create_world(levelw, levelh)
  5. -- draw_border("st-brownie")
  6.  
  7. fill_floor("fl-abyss", 0,0, level_width,level_height)
  8.  
  9.  
  10. current_point = {0,0}
  11. current_dir = NORTH
  12. function set_point(x, y) 
  13.     current_point={x,y}
  14. end
  15. function set_dir(dir)
  16.     current_dir=dir
  17. end
  18. function advance_point()
  19.     local xinc = {0,1,0,-1}
  20.     local yinc = {-1,0,1,0}
  21.     current_point[1] = current_point[1] + xinc[current_dir+1]
  22.     current_point[2] = current_point[2] + yinc[current_dir+1]
  23. end
  24.  
  25. function draw_with_floor(name, commands)
  26.     for i=1,strlen(commands) do
  27.         local c = strsub(commands, i,i)
  28.         if c=="r" then -- turn right
  29.             local tab = {EAST,SOUTH,WEST,NORTH}
  30.             current_dir = tab[current_dir+1]
  31.         elseif c=="l" then -- turn left
  32.             local tab = {WEST,NORTH,EAST,SOUTH}
  33.             current_dir = tab[current_dir+1]
  34.         else
  35.             for j=1,tonumber(c) do
  36.                 -- draw floor
  37.                 advance_point()
  38.                 set_floor(name, current_point[1], current_point[2])
  39.             end
  40.         end
  41.     end
  42. end
  43.  
  44. fl="fl-gray"
  45. fill_floor(fl, 1,1,3,3)
  46. fill_floor(fl, 6,6,3,3)
  47. fill_floor(fl, 13,2,3,3)
  48. fill_floor(fl, 15,10,3,3)
  49. fill_floor(fl, 2,7,3,3)
  50. -- fill_floor(fl, 3,12,3,3)
  51.  
  52. set_stone("st-bombs", 10,7)
  53.  
  54. set_point(2,2)
  55. set_dir(EAST)
  56. --advance_point()
  57. draw_with_floor(fl, "5r5l4l4r3r5l2r3r94")
  58. set_point()
  59.  
  60. --fl="fl-sand"
  61. -- draw_floor(fl, {4,2}, {1,0}, 3)
  62. -- draw_floor(fl, {7,2}, {0,1}, 5)
  63. -- draw_floor(fl, {9,8}, {1,0}, 2)
  64. -- draw_floor(fl, {11,8}, {0,-1}, 6)
  65. -- draw_floor(fl, {11,3}, {1,0}, 2)
  66. -- draw_floor(fl, {14,5}, {0,1}, 3)
  67. -- draw_floor(fl, {15,10}, {0,1}, 5)
  68.  
  69.  
  70. -- oxyd(3,3)
  71. -- oxyd(level_width-4,level_height-4)
  72. -- oxyd(level_width-4, 3)
  73. oxyd(3,level_height-4)
  74. --oxyd_shuffle()
  75. set_stone("st-chameleon", 3,3)
  76.  
  77. set_actor("ac-blackball", 2,2, {player=0})
  78.  
  79.