All examples · Physics · As Markdown, for AIs

Sheepdog

What this example shows

A field seen from above, with no gravity. The dog runs after the pointer, the sheep run away from the dog, and the job is to get them all into the pen.

moveTowards takes the dog to the pointer at its speed and stops it there. accelerateTowards speeds a sheep away from a dog that comes close, and it drifts to a stop. bounds: 'stop' makes the world the field, and nothing gets out of it. onTileEnter and onTileExit slow the dog to a crawl in the pond and let it run again out of it. Space opens and closes the gate, its body switched off with enabled. The ball's bounce is by axis: it keeps all its speed off the side fences and little off the others.

Starting
Starting
—