The Game Dev Atlas, Act I, The Pixel Art Island: an engraved map of an island whose towns are the techniques of pixel art for games.
Unrolling the map...
by Sprite Fusion

Motion · Act I

Pixel art loop. A hermit crab whose shell is a small cottage walks across twelve boulders in the sea. For a moment its legs show as two bones each, with every hold marked and the room one foot is allowed, then it walks on.
Act I, fig. 4 A hermit crab carries its cottage over the rocks. Each foot finds its own hold, and no walk was drawn.

Imagine a creature whose legs automatically adapt to the terrain underneath. No manual drawing of walk/run cycles. This is possible and well known! A foot stays planted until the body leaves it behind, then steps to a new hold.

Give my creature procedural legs: feet that plant and step, two-bone inverse kinematics, no walk cycle.
Read the whole brief
Give [my crab] procedural legs. No walk cycle: code places the legs every frame.

- The body moves on its own and knows nothing of legs.
- Each leg: a hip fixed to the body, a foot, and two bones between them of [7] and [10] px.
- Find the knee with the law of cosines (two-bone inverse kinematics). Front knees bend forward, back knees backward.
- A foot stays planted until it is more than [7] px from its home, a point that travels with the body. Then it steps.
- A step takes [0.24] s, lifts the foot [5] px, and lands on the ground a little ahead of home.
- Legs step in diagonal pairs, in turn. Never lift two neighbors at once.
- The body rides at the mean height of its feet, a moment late.
- Draw the legs in whole pixels, in my sprite's outline color. The body stays a sprite.

Change what stands in [brackets] to fit your game.

  1. When the terrain is complex, or can change. A good example is the stickman animation in Destroy Any Website.
  2. Spiders, robots, and things that have many legs. Perfect use-case.

Not forPlatformers where the terrain is predictable, or when your character's legs can't be easily modeled as stick shapes.

Rain World's creatures have their limbs placed by code each frame.[1] The rule of the step is set out in WeaverDev's tutorial,[2] and the two-bone leg in Alan Zucconi's series.[3] The crab and its gait are this atlas's own.

  1. Exploring procedural design in Rain World, Unity blog
  2. WeaverDev, Procedural animation tutorial
  3. Alan Zucconi, Inverse kinematics in 2D, 2018