Files
llamamod/levels/sprunglabor.py
T

69 lines
3.4 KiB
Python

"""Sprunglabor ("jump lab"): measures how high/far the llama jumps (for parkour spacing).
Lane A (z=20): steps of increasing height; lane B (z=26): gaps of increasing width."""
LEVEL_ARGS = dict(name='Sprunglabor')
def build(L):
L.sea(0, 0, 60, 40, y=-2.0, kill=(4, 10, 56, 34))
lane = L.opts.get('spur', 'a')
if lane == 'f':
# long jump over water (fall = respawn at start): start island, then 2-long blocks at the
# same height with gaps 0.5/0.7/0.9/1.1/1.3; step lane g next to it (z=26): +0.2/+0.3 with 0.4
L.box(8, 17, 14, 29, -1, 0, top='stein', side='stein_kante', rot=0)
x = 14
for i, gap in enumerate([0.5, 0.7, 0.9, 1.1, 1.3]):
x += gap
L.box(x, 18, x + 2, 22, -1, 0, top='holz_maser' if i % 2 == 0 else 'stein', side='stein_kante', rot=0)
x += 2
x, y = 14, 0.0
for i, (gap, dy) in enumerate([(0.4, 0.2), (0.4, 0.2), (0.4, 0.3), (0.5, 0.2), (0.6, 0.2)]):
x += gap; y += dy
L.box(x, 24, x + 2, 28, -1, y, top='holz_maser' if i % 2 == 0 else 'stein', side='stein_kante', rot=0)
x += 2
L.player(11, 26 if L.opts.get('z') == 'g' else 20, rot=90)
return
L.box(10, 14, 50, 30, -1, 0, top='gras', side='erde', side_top='graskante')
if lane == 'm':
# coin measuring track: a coin every 0.25 from x=12 -> coin counter = distance travelled x4
L.coins([(12 + 0.25 * i, 20) for i in range(int(L.opts.get('n', 112)))])
L.player(11.5, 20, rot=90)
return
if lane == 'e':
# measuring track: cross stripes every 1 unit (alternating white/red), llama at x=11.5
for i in range(12, 48):
L.floor(i, 19, i + 0.15, 21, 0.01, 'weiss' if i % 5 else 'rot', coll=False)
L.player(11.5, 20, rot=90)
elif lane == 'd':
# gaps 0.5 / 0.75 / 1.0 / 1.25 between 0.6-high blocks (1.5 long each)
L.box(10, 18, 14, 22, 0, 0.6, top='stein', side='stein_kante', rot=0)
x = 14
for i, gap in enumerate([0.5, 0.75, 1.0, 1.25]):
x += gap
L.box(x, 18, x + 1.5, 22, 0, 0.6, top='holz_maser' if i % 2 == 0 else 'stein', side='stein_kante', rot=0)
x += 1.5
L.player(11, 20, rot=90)
elif lane == 'c':
# single blocks of increasing height, 2 long each, 3 apart
for i, h in enumerate([0.2, 0.35, 0.5, 0.7, 0.9]):
x = 16 + i * 5
L.box(x, 18, x + 2, 22, 0, h, top='holz_maser' if i % 2 else 'stein', side='stein_kante', rot=0)
L.box(x - 0.1, 17.4, x + 0.1, 17.6, 0, 1.5, top='rot', side='rot', solid=False) # marker
L.player(12, 20, rot=90)
elif lane == 'a':
# steps: heights 0.5, 1.0, 1.5, 2.25, 3.0 (2 deep each)
x = 16
for h, tex in [(0.5, 'stein'), (1.0, 'holz_maser'), (1.5, 'stein'), (2.25, 'holz_maser'), (3.0, 'stein')]:
L.box(x, 18, x + 2, 22, 0, h, top=tex, side='stein_kante', rot=0)
x += 2
L.player(12, 20, rot=90)
else:
# gaps: platforms at 1.0, gaps 1.0, 1.5, 2.0, 2.5, 3.0
x = 12
L.box(x, 24, x + 4, 28, 0, 1.0, top='stein', side='stein_kante', rot=0)
x += 4
for gap in [1.0, 1.5, 2.0, 2.5, 3.0]:
x += gap
L.box(x, 24, x + 2, 28, 0, 1.0, top='holz_maser' if gap % 1 else 'stein', side='stein_kante', rot=0)
x += 2
L.player(13, 26, rot=90)