share/hedgewars/Data/Scripts/Multiplayer/DiagonalMaze.lua
changeset 11064 884f40b6f640
parent 11063 c57f815cbb14
child 14458 99117df5a3d3
equal deleted inserted replaced
11063:c57f815cbb14 11064:884f40b6f640
     4 end
     4 end
     5 
     5 
     6 function onGameInit()
     6 function onGameInit()
     7     MapGen = mgDrawn
     7     MapGen = mgDrawn
     8     TemplateFilter = 0
     8     TemplateFilter = 0
     9     local step = 80 + 10 * MapFeatureSize;
     9     local step = 80 + 10 * MapFeatureSize
       
    10     local width = 1 + div(math.max(0, MapFeatureSize-12), 6)
       
    11     -- center maze
       
    12     local xoff = div((4000 % step), 2)
    10     for y = 48,2048,step do
    13     for y = 48,2048,step do
    11        for x = 48,4048,step do
    14        for x = 48+xoff,4048-step,step do
    12             if GetRandom(2) == 0 then
    15             if GetRandom(2) == 0 then
    13                 AddPoint(x,y,1)
    16                 AddPoint(x,y,width)
    14                 AddPoint(x+step,y+step)
    17                 AddPoint(x+step,y+step)
    15             else
    18             else
    16                 AddPoint(x,y+step,1)
    19                 AddPoint(x,y+step,width)
    17                 AddPoint(x+step,y)
    20                 AddPoint(x+step,y)
    18             end
    21             end
    19         end
    22         end
    20     end
    23     end
    21     FlushPoints()
    24     FlushPoints()