/[enigma]/enigma/data/levels/ant06.lua
ViewVC logotype

Diff of /enigma/data/levels/ant06.lua

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by ant_39, Mon Feb 10 19:59:07 2003 UTC revision 1.3 by ant_39, Fri Feb 21 18:01:59 2003 UTC
# Line 6  Line 6 
6  dofile(enigma.FindDataFile("levels/ant.lua"))  dofile(enigma.FindDataFile("levels/ant.lua"))
7    
8  -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --  -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
9    function tick()
10  boldercount=0     for _=1,3 do
11  function add_bolder(x,y,dir)        local bid = random(1,getn(bolders))
12     boldercount = boldercount + 1        local dir = random(0,3)
13     set_stone("st-bolder", x, y, {name="bolder"..boldercount, direction=dir})        set_attribs(bolders[bid], {direction=dir})
 end  
   
 function add_bolder_west(x,y)  add_bolder(x,y,enigma.WEST) end  
 function add_bolder_east(x,y)  add_bolder(x,y,enigma.EAST ) end  
 function add_bolder_south(x,y) add_bolder(x,y,enigma.SOUTH) end  
   
 function bolder_dir()  
    for i = 1,3 do  
       local bid = random(1,boldercount)  
       local dir = random(0,4)  
   
       if (dir ~= 4) then  
          set_attribs(enigma.GetNamedObject("bolder"..bid), {direction=dir})  
       end  
14     end     end
15  end  end
16    -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
17    
18  cells={}  cells={}
19  cells[" "]=cell{floor={face="fl-sand"}}  cells[" "]=cell{floor={face="fl-sand"}}
20  cells["#"]=cell{parent={cells[" "]},stone={face="st-greenbrown"}}  cells["#"]=cell{stone={face="st-greenbrown"}}
21  cells["x"]=cell{parent={cells[" "]},stone={face="st-grate1"}}  cells["x"]=cell{stone={face="st-grate1"}}
22  cells["@"]=cell{parent={cells[" "]},stone={face="st-wood"}}  cells["@"]=cell{stone={face="st-wood"}}
23  cells["O"]=cell{parent={cells[" "]},item={face="ac-blackball", attr={player=0}, actor=1}}  cells["O"]=cell{actor={face="ac-blackball", attr={player=0}}}
24  cells["A"]=cell{parent={cells[" "]},stone={face="st-door", attr={name="doorA", type="v"}}}  cells["A"]=cell{stone={face="st-door", attr={name="doorA", type="v"}}}
25  cells["B"]=cell{parent={cells[" "]},stone={face="st-door", attr={name="doorB", type="v"}}}  cells["B"]=cell{stone={face="st-door", attr={name="doorB", type="v"}}}
26  cells["C"]=cell{parent={cells[" "]},stone={face="st-door", attr={name="doorC", type="h"}}}  cells["C"]=cell{stone={face="st-door", attr={name="doorC", type="h"}}}
27  cells["D"]=cell{parent={cells[" "]},stone={face="st-door", attr={name="doorD", type="h"}}}  cells["D"]=cell{stone={face="st-door", attr={name="doorD", type="h"}}}
28  cells["a"]=cell{parent={cells[" "]},item={face="it-trigger", attr={action="openclose", target="doorA"}}}  cells["a"]=cell{item= {face="it-trigger", attr={action="openclose", target="doorA"}}}
29  cells["b"]=cell{parent={cells[" "]},item={face="it-trigger", attr={action="openclose", target="doorB"}}}  cells["b"]=cell{item= {face="it-trigger", attr={action="openclose", target="doorB"}}}
30  cells["c"]=cell{parent={cells[" "]},item={face="it-trigger", attr={action="openclose", target="doorC"}}}  cells["c"]=cell{item= {face="it-trigger", attr={action="openclose", target="doorC"}}}
31  cells["d"]=cell{parent={cells[" "]},item={face="it-trigger", attr={action="openclose", target="doorD"}}}  cells["d"]=cell{item= {face="it-trigger", attr={action="openclose", target="doorD"}}}
32  cells["0"]=cell{parent={cells[" "], oxyd}}  cells["0"]=oxyd
33  cells[">"]=cell{parent={cells[" "], add_bolder_south}}  bolders={}
34  cells["<"]=cell{parent={cells[" "], add_bolder_east}}  cells["V"]=cell{parent={{add_multistone, "st-bolder", bolders, {direction=SOUTH}}}}
35  cells["^"]=cell{parent={cells[" "], add_bolder_west}}  cells["<"]=cell{parent={{add_multistone, "st-bolder", bolders, {direction=WEST }}}}
36  cells["~"]=cell{parent={cells[" "]},stone={face="st-timer", attr={action="callback", target="bolder_dir", interval=0.25}}}  cells["^"]=cell{parent={{add_multistone, "st-bolder", bolders, {direction=NORTH}}}}
37    cells["~"]=cell{stone={face="st-timer", attr={action="callback", target="tick", interval=0.10}}}
38    
39  level = {  level = {
40     "############~############",     "####################",
41     "#          0#0          #",     "#  #     V V V  #  #",
42     "#          0#0          #",     "#  A    # # # # # O#",
43     "##A#########~########B###",     "#  #           <#  #",
44     "#         # # #         #",     "#  #            ##x#",
45     "#          <#>   b      #",     "#  #    @      <   #",
46     "#         # # #        <#",     "#  #       @       #",
47     "#          <#>      a   #",     "#  #           <   #",
48     "# #  @    # # #        <#",     "#  #     c#x#d     #",
49     "#>      c   #           #",     "#  #      x x  <   #",
50     "# #     #x#####x#      <#",     "#  ## # # # # # # ##",
51     "#>    @ x  C D  x       #",     "#00# ^ ^  #C#  ^ ^ #",
52     "# #     #x#####x#      <#",     "~########## ########",
53     "#>      d   #           #",     "#00# V V  #D#  V V #",
54     "# #       # # # @      <#",     "#  ## # # # # # # ##",
55     "#  ^ ^ ^ ^ <#>          #",     "#  #      x x      #",
56     "#####     # # #   @    <#",     "#  #      #x# @    #",
57     "#   #      <#>          #",     "#  # b             #",
58     "# O x     # #           #",     "#  #            @  #",
59     "############~############"     "#  #               #",
60       "#  #   a           #",
61       "#  B               #",
62       "#  #               #",
63       "#  #  ^ ^ ^ ^ ^ ^  #",
64       "####################"
65  }  }
66    
67  -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --  -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
 levelw = 20  
 levelh = 25  
 create_world(levelw, levelh)  
68  randomseed(enigma.GetTicks())  randomseed(enigma.GetTicks())
69    set_default_parent(cells[" "])
70  oxyd_default_flavor = "b"  oxyd_default_flavor = "b"
71  draw_map(0, 0, level, cells, TRANSPOSE_MAP)  create_world_by_map(level)
72    oxyd_shuffle()

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26