Ledger v3 · C# · Godot 4.7 Get started

Leak

A creep walking a lane to the castle, costing lives; at none the player has lost

✓ 2 plays, 24 steps, all passingFrom TD, content\td.ledger, content\creeps.ledger
pool ... regenafter Filledafter Depletedlink ... global

A creep walking a lane to the castle, lifted from the tower-defense slice's content\td.ledger (Progress, Leaking, Defeat and the Player) and its walker from content\creeps.ledger. How far a creep has walked is its pool Progress, drifting up at its Pace, and the lane is as long as the player's LaneLength says. A creep that walks the whole lane costs the player its leak in lives and is gone; at no lives the player has lost. The game lays the hundredths along its own path and stands the creep where its Progress puts it.

content/cookbook/mechanics/leak.ledgerthe content
1# A creep walking a lane to the castle, lifted from the tower-defense slice's content\td.ledger (Progress, Leaking,
2# Defeat and the Player) and its walker from content\creeps.ledger. How far a creep has walked is its pool Progress,
3# drifting up at its Pace, and the lane is as long as the player's LaneLength says. A creep that walks the whole lane
4# costs the player its leak in lives and is gone; at no lives the player has lost. The game lays the hundredths along
5# its own path and stands the creep where its Progress puts it.
6
7rate 60
8link team
9link player global
10allegiance team
11stat LaneLength
12stat LaneEnd
13stat Walk
14stat Pace
15stat Leak
16stat MaxLives
17pool Progress max LaneEnd regen Pace
18pool Lives max MaxLives whole
19tags Creep
20event Lost
22effect Leaking
23 after Filled Progress of holder
24 lose Lives holder.Leak on player
25 destroy holder
27effect Defeat
28 after Depleted Lives of holder
29 raise Lost of holder
31archetype Side
33archetype Player
34 base MaxLives 20
35 base LaneLength 100
36 full Lives
37 has Defeat
39archetype Runner
40 tags Creep
41 base Walk 3.5
42 base LaneEnd player.LaneLength
43 base Pace holder.Walk
44 base Leak 1
45 pools Progress
46 has Leaking
48archetype Brute
49 tags Creep
50 base Walk 1.6
51 base LaneEnd player.LaneLength
52 base Pace holder.Walk
53 base Leak 20
54 pools Progress
55 has Leaking
content/cookbook/mechanics/leak.playwhat it must do
1catalog leak.ledger
2
3# The lane's numbers, from the Player (20 lives, a lane of 100) and the Runner (3.5 hundredths a second, a leak of 1).
4
5play "a runner walks 3.5 a second; at the lane's end, 100 / 3.5 s on, it costs a life and is gone"
6 make a Side
7 make b Side
8 make p Player with team = a
9 link player p
10 make r Runner with team = b
11 advance 10s
12 expect r.Progress = 35 from content: the Runner's Walk 3.5 a second for 10 s
13 save
14 advance 18.5s
15 expect r alive
16 expect p.Lives = 20 from content: the Player's 20, nothing reached the castle at 28.5 s, 99.75 walked
17 advance 0.1s
18 expect r gone
19 expect p.Lives = 19 from content: 20 less the Runner's leak 1, at 100 / 3.5 = 28.57 s
21play "a brute leaking 20 takes the last lives, and the player has lost"
22 make a Side
23 make b Side
24 make p Player with team = a
25 link player p
26 make bt Brute with team = b
27 set bt.Progress = 99
28 advance 1s
29 expect bt gone
30 expect p.Lives = 0 from content: 20 less the Brute's leak 20
31 expect event Lost of p

Run it yourself

ledger check content/cookbook/mechanics/leak.ledger content/cookbook/mechanics/leak.play
ledger play content/cookbook/mechanics/leak.play