Dimitri Glazkov

A ball on a slope

· 1 min read

A sample post, written for the engine's tests. I'll begin with a simple picture: a ball rolling down a shallow slope. Driven by gravity, it seeks the easiest way down. The slope is full of ridges, channels and nubs, and they make the ball bounce and veer.

A ball on a slope, drawn as a sample

If thinking is something like the motion of that ball, then what we know is the terrain. This sample links back to recipes for a sample, and to casino samples, so that the margin has something to show around it.

fn roll(ball: &mut Ball, slope: &Slope) {
    ball.velocity += slope.gradient(ball.at) * DT;
}

That is all of it: a picture, a code block wider than a phone, and two links in.