share/hedgewars/Data/Scripts/Multiplayer/DiagonalMaze.lua
author Wuzzy <Wuzzy2@mail.ru>
Mon, 13 Nov 2017 22:14:45 +0100
changeset 12836 8610462e3d33
parent 11064 884f40b6f640
child 14479 99117df5a3d3
permissions -rw-r--r--
Remove 2 unused number tags in Construction Mode GUI These numbers are shown aside the power tag, but the numbers never change. They don't serve any purpose and are just visual clutter and annoying, since they partially overlap. They are probably a leftover from copying code over from other scripts. With this changeset, only the power and turn time are left visible, as it is supposed to.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10604
f2f9928ea2e7 Sheepluva thought this was worth adding.
nemo
parents:
diff changeset
     1
f2f9928ea2e7 Sheepluva thought this was worth adding.
nemo
parents:
diff changeset
     2
function onPreviewInit()
f2f9928ea2e7 Sheepluva thought this was worth adding.
nemo
parents:
diff changeset
     3
onGameInit()
f2f9928ea2e7 Sheepluva thought this was worth adding.
nemo
parents:
diff changeset
     4
end
f2f9928ea2e7 Sheepluva thought this was worth adding.
nemo
parents:
diff changeset
     5
f2f9928ea2e7 Sheepluva thought this was worth adding.
nemo
parents:
diff changeset
     6
function onGameInit()
f2f9928ea2e7 Sheepluva thought this was worth adding.
nemo
parents:
diff changeset
     7
    MapGen = mgDrawn
f2f9928ea2e7 Sheepluva thought this was worth adding.
nemo
parents:
diff changeset
     8
    TemplateFilter = 0
11064
884f40b6f640 some more tweaks
sheepluva
parents: 11063
diff changeset
     9
    local step = 80 + 10 * MapFeatureSize
884f40b6f640 some more tweaks
sheepluva
parents: 11063
diff changeset
    10
    local width = 1 + div(math.max(0, MapFeatureSize-12), 6)
884f40b6f640 some more tweaks
sheepluva
parents: 11063
diff changeset
    11
    -- center maze
884f40b6f640 some more tweaks
sheepluva
parents: 11063
diff changeset
    12
    local xoff = div((4000 % step), 2)
11063
c57f815cbb14 make diagonal maze use map feature size
sheepluva
parents: 10611
diff changeset
    13
    for y = 48,2048,step do
11064
884f40b6f640 some more tweaks
sheepluva
parents: 11063
diff changeset
    14
       for x = 48+xoff,4048-step,step do
10604
f2f9928ea2e7 Sheepluva thought this was worth adding.
nemo
parents:
diff changeset
    15
            if GetRandom(2) == 0 then
11064
884f40b6f640 some more tweaks
sheepluva
parents: 11063
diff changeset
    16
                AddPoint(x,y,width)
11063
c57f815cbb14 make diagonal maze use map feature size
sheepluva
parents: 10611
diff changeset
    17
                AddPoint(x+step,y+step)
10604
f2f9928ea2e7 Sheepluva thought this was worth adding.
nemo
parents:
diff changeset
    18
            else
11064
884f40b6f640 some more tweaks
sheepluva
parents: 11063
diff changeset
    19
                AddPoint(x,y+step,width)
11063
c57f815cbb14 make diagonal maze use map feature size
sheepluva
parents: 10611
diff changeset
    20
                AddPoint(x+step,y)
10604
f2f9928ea2e7 Sheepluva thought this was worth adding.
nemo
parents:
diff changeset
    21
            end
f2f9928ea2e7 Sheepluva thought this was worth adding.
nemo
parents:
diff changeset
    22
        end
f2f9928ea2e7 Sheepluva thought this was worth adding.
nemo
parents:
diff changeset
    23
    end
f2f9928ea2e7 Sheepluva thought this was worth adding.
nemo
parents:
diff changeset
    24
    FlushPoints()
f2f9928ea2e7 Sheepluva thought this was worth adding.
nemo
parents:
diff changeset
    25
end