34 lines
1.4 KiB
Text
34 lines
1.4 KiB
Text
-- Mash and hold on the branching track: one window wants RIGHT six times, the next wants UP
|
|
-- held for twenty frames, the last wants RIGHT mashed again and gets too few.
|
|
return {
|
|
title = "Author test: mash and hold",
|
|
layers = { { kind = "disc", file = "Singe/menuBackground.mkv", start = 100 }, { kind = "overlay" } },
|
|
vars = { taken = 0, missed = 0, wanted = 0, opened = "" },
|
|
|
|
types = {
|
|
dirk = { look = { kind = "none" }, behaviours = { { kind = "branching", track = "moves" } } }
|
|
},
|
|
|
|
rooms = {
|
|
{ name = "cavern",
|
|
entities = { { type = "dirk", id = "dirk", x = 0, y = 0 } },
|
|
tracks = {
|
|
{ name = "moves", key = "frame",
|
|
branches = { { from = 120, to = 160, move = "RIGHT", mash = 6, success = 200, fail = 200 },
|
|
{ from = 200, to = 240, move = "UP", hold = 20, success = 280, fail = 280 },
|
|
{ from = 280, to = 320, move = "RIGHT", mash = 6, success = 340, fail = 340 } } }
|
|
} }
|
|
},
|
|
|
|
rules = {
|
|
{ note = "A window opens: remember what it wants",
|
|
on = "branchOpen",
|
|
act = { { "setVar", name = "wanted", value = "event.mash or event.hold or 0" }, { "setVar", name = "opened", value = "opened .. event.move .. \" \"" } } },
|
|
{ note = "Made it",
|
|
on = "branchTaken",
|
|
act = { { "addVar", name = "taken", amount = 1 } } },
|
|
{ note = "Missed it",
|
|
on = "branchMissed",
|
|
act = { { "addVar", name = "missed", amount = 1 } } }
|
|
}
|
|
}
|