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

  1. -- Erich Schubert
  2. levelw = 39
  3. levelh = 25
  4.  
  5. create_world(levelw, levelh)
  6. draw_border("st-brownie")
  7.  
  8. fill_floor("fl-water", 0,0, level_width,level_height)
  9.  
  10.  
  11. current_point = {0,0}
  12. current_dir = 0
  13. function set_point(x, y) 
  14.     current_point={x,y}
  15. end
  16. function set_dir(dir)
  17.     current_dir=dir
  18. end
  19. function advance_point()
  20.     local xinc = {0,1,0,-1}
  21.     local yinc = {-1,0,1,0}
  22.     current_point[1] = current_point[1] + xinc[current_dir+1]
  23.     current_point[2] = current_point[2] + yinc[current_dir+1]
  24. end
  25.  
  26. function draw_with_floor(name, commands)
  27.     for i=1,strlen(commands) do
  28.         local c = strsub(commands, i,i)
  29.         if c=="r" then -- turn right
  30.             local tab = {1,2,3,0}
  31.             current_dir = tab[current_dir+1]
  32.         elseif c=="l" then -- turn left
  33.             local tab = {3,0,1,2}
  34.             current_dir = tab[current_dir+1]
  35.         else
  36.             for j=1,tonumber(c) do
  37.                 -- draw floor
  38.                 advance_point()
  39.                 set_floor(name, current_point[1], current_point[2])
  40.             end
  41.         end
  42.     end
  43. end
  44.  
  45. fl="fl-gray"
  46. -- with oxyd stone:
  47. fill_floor(fl, 1,1,3,3)
  48. fill_floor(fl, 6,6,3,3)
  49. fill_floor(fl, 13,2,3,3)
  50. fill_floor(fl, 15,10,3,3)
  51. -- fill_floor(fl, 2,7,3,3)
  52. fill_floor(fl, 3,10,3,3)
  53. -- with oxyd stone:
  54. fill_floor(fl, 1,19,3,3)
  55. fill_floor(fl, 8,21,3,3)
  56. fill_floor(fl, 13,14,3,3)
  57. fill_floor(fl, 17,19,3,3)
  58. fill_floor(fl, 24,13,3,3)
  59. fill_floor(fl, 21,21,3,3)
  60. -- with oxyd stone:
  61. fill_floor(fl, 35,21,3,3)
  62. -- on fourth screen
  63. fill_floor(fl, 30,8,3,3)
  64. fill_floor(fl, 30,2,3,3)
  65. -- with oxyd stone:
  66. fill_floor(fl, 35,1,3,3)
  67.  
  68. -- set_stone("st-bombs", 10,7)
  69.  
  70. fl="fl-sand"
  71. set_point(2,2)
  72. set_dir(1)
  73. advance_point()
  74. -- on first screen
  75. draw_with_floor(fl, "4r5l4l4r3r5l2r3r93l4")
  76. -- on second screen
  77. draw_with_floor(fl, "r2l8l4l1r3l7r5r8l4l6r4")
  78. -- on third screen
  79. draw_with_floor(fl, "l3r3r5r3l3l5l2r2r2l2l2r2r2l3l5l1r1l1r1l1r1l1r1l1r4")
  80. -- on fourth screen
  81. draw_with_floor(fl, "l91r2r7l2l7r2r91r3l3r3l3l5")
  82. set_point()
  83.  
  84. -- fl="fl-sand"
  85. -- draw_floor(fl, {4,2}, {1,0}, 3)
  86. -- draw_floor(fl, {7,2}, {0,1}, 4)
  87. -- draw_floor(fl, {9,8}, {1,0}, 2)
  88. -- draw_floor(fl, {11,8}, {0,-1}, 6)
  89. -- draw_floor(fl, {11,3}, {1,0}, 2)
  90. -- draw_floor(fl, {14,5}, {0,1}, 8)
  91. -- draw_floor(fl, {15,10}, {0,1}, 3)
  92.  
  93.  
  94. oxyd(2,0)
  95. oxyd(level_width-1,level_height-3)
  96. oxyd(level_width-1, 2)
  97. oxyd(0,level_height-5)
  98. oxyd_shuffle()
  99. -- set_stone("st-chameleon", 3,3)
  100.  
  101. set_actor("ac-blackball", 2, 2, {player=0})
  102.  
  103.  
  104.