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

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

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

revision 1.6 by ant_39, Mon Feb 3 18:33:35 2003 UTC revision 1.7 by ant_39, Sun Feb 9 17:46:50 2003 UTC
# Line 5  Line 5 
5  -- 2003-01-07 -- special floor types and train support  -- 2003-01-07 -- special floor types and train support
6  -- 2003-01-11 -- multiples support (groups of doors, bolders etc.)  -- 2003-01-11 -- multiples support (groups of doors, bolders etc.)
7  -- 2003-01-14 -- bugfixes and error reporting, some new map-creating funcs  -- 2003-01-14 -- bugfixes and error reporting, some new map-creating funcs
8    -- 2003-02-09 -- fixes of rubberband functions and some other minor changes
9    
10    
11    
12    -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
13    -- FOR ARRAYS  -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
14    -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
15    
16    function getkey(x,y)
17       return x..","..y
18    end
19    
20    
21    
22  -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --  -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
# Line 92  function get_map_width(level) Line 104  function get_map_width(level)
104    
105     return levelw     return levelw
106  end  end
107    
108  -- height is just number of lines  -- height is just number of lines
109  function get_map_height(level)  function get_map_height(level)
110     return getn(level)     return getn(level)
111  end  end
112    
113  -- and size combined  -- and size combined
114  function get_map_size(level)  function get_map_size(level)
115     return get_map_width(level), get_map_height(level)     return get_map_width(level), get_map_height(level)
# Line 137  function create_world_by_map(level, swap Line 151  function create_world_by_map(level, swap
151  end  end
152    
153  -- to fill each square of map with given function  -- to fill each square of map with given function
154  function fill_world_func(fillfunc)  function fill_world_func(fillfunc, x0, y0, w, h)
155     for x=0,level_width-1 do     for x=(x0 or 0), ((w or level_width)-1) do
156        for y=0,level_height-1 do        for y=(y0 or 0), ((h or level_height)-1) do
157           fillfunc(x, y)           fillfunc(x, y)
158        end        end
159     end     end
160  end  end
161    
162  -- to draw border of map by given function  -- to draw border of map by given function
163  function draw_border_func(fillfunc)  function draw_border_func(fillfunc, x0, y0, w, h)
164     for x=0,level_width-1 do     local x0, y0 = (x0 or 0), (y0 or 0)
165        fillfunc(x, 0)     local w, h = (w or level_width), (h or level_height)
166        fillfunc(x, level_height-1)  
167       for x=x0,w-1 do
168          fillfunc(x, y0)
169          fillfunc(x, y0+h-1)
170     end     end
171    
172     for y=0,level_height-1 do     for y=y0,h-1 do
173        fillfunc(0, y)        fillfunc(x0, y)
174        fillfunc(level_width-1, y)        fillfunc(x0+w-1, y)
175     end     end
176  end  end
177    
# Line 170  pathway_directions = {{ 1, 0}, { 0, 1}, Line 187  pathway_directions = {{ 1, 0}, { 0, 1},
187  path = {}  path = {}
188  path.constructor = {}  path.constructor = {}
189    
 -- globals  
   
 function getkey(x,y) return x..","..y end  
   
190  -- pathworks  -- pathworks
191    
192  function new_path_item(x,y,tag,context)  function new_path_item(x,y,tag,context)
# Line 275  function add_multiactor(args, x, y) Line 288  function add_multiactor(args, x, y)
288     group[bc] = obj     group[bc] = obj
289  end  end
290    
291  function add_rubber_bands(gr1, gr2, length)  function add_rubber_bands(gr1, gr2, strength, length)
292     for _,obj1 in gr1 do     for _,obj1 in gr1 do
293        for _,obj2 in gr2 do        for _,obj2 in gr2 do
294           AddRubberBand(obj1, obj2, length, 0)           AddRubberBand(obj1, obj2, strength, length)
295        end        end
296     end     end
297  end  end
298    
299  function add_rubber_band_pairs(gr1, gr2, length)  function add_rubber_band_pairs(gr1, gr2, strength, length)
300     for key1,obj1 in gr1 do     for key1,obj1 in gr1 do
301        AddRubberBand(obj1, gr2[key1], length, 0)        AddRubberBand(obj1, gr2[key1], strength, length)
302     end     end
303  end  end
304    

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7

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