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

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

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

revision 1.3 by ant_39, Mon Feb 10 19:59:07 2003 UTC revision 1.4 by ant_39, Fri Feb 21 18:01:59 2003 UTC
# Line 8  dofile(enigma.FindDataFile("levels/ant.l Line 8  dofile(enigma.FindDataFile("levels/ant.l
8    
9  -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --  -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
10  count_revert = nil  count_revert = nil
11    revert_dir = nil
12    
13  function revert_bolders()  function revert_bolders()
14     --open/close all doors in map     --open/close all doors in map
# Line 15  function revert_bolders() Line 16  function revert_bolders()
16    
17     --on every odd triggger invert bolder dir     --on every odd triggger invert bolder dir
18     if (not(count_revert)) then     if (not(count_revert)) then
19        for _,bolder in bolders do        if (revert_dir)
20           local dir = enigma.GetAttrib(bolder, "direction")        then set_group_attribs(bolders, {direction=EAST})
21           dir = dir - 2        else set_group_attribs(bolders, {direction=WEST})
          while (dir<0) do  
             dir = dir +4  
          end  
          enigma.SetAttrib(bolder, "direction", dir)  
22        end        end
23          revert_dir = not(revert_dir)
24     end     end
25    
26     count_revert = not(count_revert)     count_revert = not(count_revert)
# Line 32  end Line 30  end
30    
31  cells={}  cells={}
32    
33  cells[" "]=cell{floor={face="fl-marble"}}  cells[" "]=cell{floor="fl-marble"}
34  cells["."]=cell{floor={face="fl-water"}}  cells["."]=cell{floor="fl-water"}
35  cells["#"]=cell{parent=cells["."],stone={face="st-marble"}}  cells["#"]=cell{parent=cells["."],stone="st-marble"}
36  cells["V"]=cell{parent={cells[" "], {laser, TRUE, SOUTH}}}  cells["V"]=cell{{{laser, TRUE, SOUTH}}}
37  cells["^"]=cell{parent={cells[" "], {laser, TRUE, NORTH}}}  cells["^"]=cell{{{laser, TRUE, NORTH}}}
38  cells["+"]=cell{parent=cells[" "],item={face="it-trigger", attr={action="callback", target="revert_bolders"}}}  cells["+"]=cell{item={"it-trigger", {action="callback", target="revert_bolders"}}}
39    
40  bolders = {}  bolders = {}
41  doors   = {}  doors   = {}
42  cells[">"]=cell{parent={cells[" "], {add_multistone, {"st-bolder", bolders, {direction=enigma.EAST}}}}}  cells[">"]=cell{{{add_multistone, "st-bolder", bolders, {direction=EAST}}}}
43  cells["="]=cell{parent={cells["."], {add_multistone, {"st-door_a", doors, {type="h"}}}}}  cells["="]=cell{{{add_multistone, "st-door_a", doors, {type="h"}}, cells["."]}}
44    
45  cells["0"]=cell{parent={cells[" "], oxyd}}  cells["0"]=oxyd
46  cells["O"]=cell{parent=cells[" "],item={face="ac-blackball", attr={player=0}, actor=1}}  cells["O"]=cell{actor={"ac-blackball", {player=0}}}
47    
48  level = {  level = {
49     "#########V##########",     "#########V##########",
# Line 65  level = { Line 63  level = {
63    
64  -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --  -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
65  oxyd_default_flavor="c"  oxyd_default_flavor="c"
66    set_default_parent(cells[" "])
67  create_world_by_map(level)  create_world_by_map(level)
68  oxyd_shuffle()  oxyd_shuffle()

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

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