Learn the motion language
Ten short lessons, each one program. Open each in the lab, press Play, and change a number to see what it does. The whole language is in the guide.
1. A line
bend right knee 40A line says what one part does. Its words go in one order: the action (bend), the side (right), the part (knee), the way it goes if it has one, and how far. A number is degrees from standing. knee 40 right bend is not a line: the lab says where it goes wrong and how it is written. Open it in the lab.
2. At the same time, and how long
raise both arms up and nod head up 20 over 0.5 sand joins parts that move together. both takes the part's plural (both arms). How long the line takes goes at its end: over 0.5 s. Open it.
3. One after another
raise right arm out 90 over 0.4 s
bend right elbow 90 over 0.3 s
lower right arm and straighten right elbow over 0.4 sEach line starts when the one before it ends. A part stays where its last line put it. Open it.
4. Words made of words
walk steps 4walk is a word of the language's library, written in the language itself: two steps, round again, then a stop. It takes values by name, each name then its value (walk steps 4 pace 0.6). Gravity is real in the lab: a step only works with the weight over the other foot, which is what walk does for you. Open it, and type help there to see every word.
5. A loop that counts
repeat 3 as i:
nod head down i * 10 over 0.3 s
nod head up 0 over 0.3 sA line ending in : opens a block, and its lines are indented under it. repeat 3 runs them three times; as i counts the rounds (1, 2, 3), so the nods go 10, 20, 30 degrees deep. Open it.
6. Your own word, for each side
define reach(side = right, far = 90):
raise side arm forward far over 0.4 s
lower side arm over 0.4 s
for side in left, right:
reach sidedefine makes a word: its name, its values and what each is when not given. for runs its lines once for each value. Here each arm reaches in turn. Open it%3A%0A%20%20raise%20side%20arm%20forward%20far%20over%200.4%20s%0A%20%20lower%20side%20arm%20over%200.4%20s%0Afor%20side%20in%20left%2C%20right%3A%0A%20%20reach%20side).
7. A condition on the body
lift left foot 10 cm over 0.3 s
if left foot is down:
nod
else:
raise both arms out 90 over 0.4 sif asks the body as the lines so far leave it. The left foot is up, so the arms go out. Other conditions: a foot lands, both feet are down, it would fall, left knee is over 90. Open it.
8. A loop that stops
high = 0
repeat 10:
raise both arms forward high over 0.2 s
high = high + 30
if high is over 120:
break
lower both arms over 0.4 shigh is a name for a value that changes as the loop goes round. break leaves the loop, and the program goes on with the line after it. The arms go up 0, 30, 60, 90 and 120 degrees, then down. Open it.
9. A dog
perk both ears
wag
trot steps 4A dog has its own words: a front and a back to its legs (front left paw, both back legs), a tail and ears, and its own library (wag, trot, walk, sit, lie). Open it on the dog.
10. A scene
cast:
sunny = sunny at 0 0
rex = dog at 3 2 facing sunny
sunny:
says "Rex! Come here!"
turns to rex
rex:
walks to sunny
together:
sunny: wave
rex: wag
sunny:
looks at rex
says "Good dog."A scene is a cast and what each one does, in order or together. Each character runs its own lines in the language; the scene works out the waits, the turns toward each other and the steps between them. Open the scene.