ludic/packages/ludic.anim/tests/sets.lres

29 lines
1.2 KiB
Text

# sets.lres - the test's one set: a ground state picking by speed bands, a one-shot that hands back,
# a hop the code never asks for, taken when toy_hops says so, a bow no rig carries, and a seat and a
# perch the code asks for by way of a one-shot (settle, which the rig has; bow, which it has not)
toy {
entry: "ground"
params: ["speed"]
states: [
{
key: "ground"
rate_min: 0.5, rate_max: 2.0, blend: 0.2
choices: [
{ clip: "run", rate_by: "speed", ground: 2.0, need: [{ param: "speed", over: 4.0 }] },
{ clip: "walk", rate_by: "speed", ground: 4.0, need: [{ param: "speed", over: 0.5 }] },
{ clip: "idle" }
]
},
{ key: "wave", loop: false, next: "ground", choices: [{ clip: "wave" }] },
{ key: "hop", choices: [{ clip: "hop" }] },
{ key: "bow", loop: false, next: "ground", choices: [{ clip: "bow" }] },
{ key: "settle", loop: false, next: "seat", choices: [{ clip: "wave" }] },
{ key: "seat", choices: [{ clip: "hop" }] },
{ key: "perch", choices: [{ clip: "walk" }] }
]
transitions: [
{ from: "ground", to: "hop", blend: 0.1, when: fn toy_hops },
{ from: "*", to: "seat", via: "settle" },
{ from: "*", to: "perch", via: "bow" }
]
}