share/hedgewars/Data/Scripts/Multiplayer/DiagonalMaze.lua
author Wuzzy <Wuzzy2@mail.ru>
Mon, 12 Mar 2018 19:39:00 +0100
changeset 13173 4d1cf0d76eb7
parent 11064 884f40b6f640
child 14458 99117df5a3d3
permissions -rw-r--r--
Remove rubber duck from BRW, RW and most weapon schemes for now The duck is not liked by players. Rubber duck needs a lot of rework. Before that happens, better remove it from game modes for now. Players can always modify the weapon schemes, of course.


function onPreviewInit()
onGameInit()
end

function onGameInit()
    MapGen = mgDrawn
    TemplateFilter = 0
    local step = 80 + 10 * MapFeatureSize
    local width = 1 + div(math.max(0, MapFeatureSize-12), 6)
    -- center maze
    local xoff = div((4000 % step), 2)
    for y = 48,2048,step do
       for x = 48+xoff,4048-step,step do
            if GetRandom(2) == 0 then
                AddPoint(x,y,width)
                AddPoint(x+step,y+step)
            else
                AddPoint(x,y+step,width)
                AddPoint(x+step,y)
            end
        end
    end
    FlushPoints()
end