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

  1.  
  2. levelw = 39
  3. levelh = 13
  4.  
  5. create_world( levelw, levelh)
  6.  
  7. fill_floor("fl-leaves", 0,0,levelw,levelh)
  8. draw_border( "st-greenbrown")
  9.  
  10. oxyd( 1, 1)
  11. oxyd( 18, 1)
  12. oxyd( 1, 6)
  13. oxyd( 5, 6)
  14. oxyd( 14, 6)
  15. oxyd( 18, 6)
  16. oxyd( 1, 11)
  17. oxyd( 18, 11)
  18. oxyd( 5, 2)
  19. oxyd( 14, 2)
  20. oxyd( 5, 10)
  21. oxyd( 14, 10)
  22.  
  23. oxyd_shuffle()
  24.  
  25. set_stone( "st-timer", 20, 1, {action="callback", target="timer_handler1"})
  26. set_stone( "st-timer", 20, 2, {action="callback", target="timer_handler2"})
  27. set_stone( "st-timer", 20, 3, {action="callback", target="timer_handler3"})
  28. set_stone( "st-timer", 20, 4, {action="callback", target="timer_handler4"})
  29.  
  30. mytimer = 0
  31.  
  32. function timer_handler1()
  33.     doora=enigma.GetNamedObject("door1")
  34.     doorb=enigma.GetNamedObject("door4")
  35.     doorc=enigma.GetNamedObject("door7")
  36.     doord=enigma.GetNamedObject("door10")
  37.     if mytimer == 0 then
  38.         enigma.SendMessage(doora, "openclose", nil)
  39.         enigma.SendMessage(doorb, "openclose", nil)
  40.     end
  41.     if mytimer == 1 then
  42.         enigma.SendMessage(doorc, "openclose", nil)
  43.         enigma.SendMessage(doord, "openclose", nil)
  44.     end
  45. end
  46. function timer_handler2()
  47.     doora=enigma.GetNamedObject("door13")
  48.     doorb=enigma.GetNamedObject("door16")
  49.     doorc=enigma.GetNamedObject("door2")
  50.     doord=enigma.GetNamedObject("door5")
  51.     if mytimer == 0 then
  52.         enigma.SendMessage(doora, "openclose", nil)
  53.         enigma.SendMessage(doorb, "openclose", nil)
  54.     end
  55.     if mytimer == 1 then
  56.         enigma.SendMessage(doorc, "openclose", nil)
  57.         enigma.SendMessage(doord, "openclose", nil)
  58.     end
  59. end
  60. function timer_handler3()
  61.     doora=enigma.GetNamedObject("door8")
  62.     doorb=enigma.GetNamedObject("door11")
  63.     doorc=enigma.GetNamedObject("door14")
  64.     doord=enigma.GetNamedObject("door3")
  65.     if mytimer == 0 then
  66.         enigma.SendMessage(doora, "openclose", nil)
  67.         enigma.SendMessage(doorb, "openclose", nil)
  68.     end
  69.     if mytimer == 1 then
  70.         enigma.SendMessage(doorc, "openclose", nil)
  71.         enigma.SendMessage(doord, "openclose", nil)
  72.     end
  73. end
  74. function timer_handler4()
  75.     doora=enigma.GetNamedObject("door6")
  76.     doorb=enigma.GetNamedObject("door9")
  77.     doorc=enigma.GetNamedObject("door12")
  78.     doord=enigma.GetNamedObject("door15")
  79.     if mytimer == 0 then
  80.         enigma.SendMessage(doora, "openclose", nil)
  81.         enigma.SendMessage(doorb, "openclose", nil)
  82.     end
  83.     if mytimer == 1 then
  84.         enigma.SendMessage(doorc, "openclose", nil)
  85.         enigma.SendMessage(doord, "openclose", nil)
  86.     end
  87.     mytimer = mytimer + 1
  88.     if mytimer == 2 then
  89.         mytimer = 0
  90.     end
  91. end
  92.  
  93. doorv(3,2,  {name="door1"})
  94. doorv(7,2,  {name="door2"})
  95. doorv(12,2, {name="door3"})
  96. doorv(16,2, {name="door4"})
  97. doorv(7,6,  {name="door5"})
  98. doorv(12,6, {name="door6"})
  99. doorh(17,8, {name="door7"})
  100. doorv(7,10, {name="door8"})
  101. doorv(12,10,{name="door9"})
  102. doorh(2,4, {name="door10"})
  103. doorh(9,4, {name="door11"})
  104. doorh(14,4,{name="door12"})
  105. doorh(17,4,{name="door13"})
  106. doorh(2,8, {name="door14"})
  107. doorh(10,8,{name="door15"})
  108. doorh(14,8,{name="door16"})
  109.  
  110. draw_stones("st-greenbrown", {19,1}, {0,1},11)
  111. draw_stones("st-greenbrown", {4,4}, {1,0},5)
  112. draw_stones("st-greenbrown", {10,4}, {1,0},4)
  113. draw_stones("st-greenbrown", {15,4}, {1,0},2)
  114. draw_stones("st-greenbrown", {4,8}, {1,0},6)
  115. draw_stones("st-greenbrown", {11,8}, {1,0},3)
  116. draw_stones("st-greenbrown", {15,8}, {1,0},2)
  117. draw_stones("st-greenbrown", {3,3}, {0,1},9)
  118. draw_stones("st-greenbrown", {16,3}, {0,1},9)
  119. set_stones("st-greenbrown", {{3,1},{7,1},{12,1},{16,1},{1,4},
  120.                             {18,4},{7,5},{12,5},{1,8}})
  121. set_stones("st-greenbrown", {{7,3},{7,7},{7,9},{12,3},{12,7},
  122.                             {7,11},{12,11},{12,9},{18,8}})
  123.  
  124. set_actor("ac-blackball", 9.5, 6.5, {player=0})
  125.