Spielerando

A Character Facing 8 Directions from One Set of Drawings

Draw the figure once, as layers seen from above, from the boots up. Code turns every layer and piles them, each a pixel higher than the one below, and out comes the figure from any side you ask for. Our beekeeper is 9 small drawings, and she faces 8 ways without a single direction being drawn.

A pixel art beekeeper with a straw hat seen from a slanted camera, eight times in a row, turned a little further each time: from the front, from the side, from behind with a blue backpack, and back.
Eight directions, one every 45 degrees, all made from the same nine drawings. The fifth shows her from behind, with her backpack.

Why not draw each direction?

Eight pictures of one figure have to agree on everything: the size of the hat, the place of the pocket, the colours. Drawn one by one, they have to be made to match by hand. Pictures from an image tool often do not show the same character twice, as AI game sprites describes. Mirroring gives you left from right, and nothing else.

Layers go around the problem. There is one set of drawings, so there is one hat.

What are the layers?

Nine small pixel drawings in a row, each a slice of the beekeeper seen from above: two boots, two trouser legs, the hips, the body with gloves and a backpack, the body, the shoulders, the head with a dark window, the wide hat brim, the top of the hat.
The nine drawings, from the boots on the left to the top of the hat on the right, each 11 by 11 pixels and seen from above.

A layer is a slice of the figure seen from above. The bottom edge of each drawing is the side that faces the viewer. Some drawings are used for several layers: the boots are two layers high, the legs three, the body three, the head three, the hat two. In all, the beekeeper is 17 layers.

Two things are worth knowing before you draw.

You mostly see front edges. Each layer covers the one below it, except for a strip one pixel high at the front. So the beekeeper's face is not drawn on one layer. It is the dark pixels in the front row of the head drawing, three layers of them, one above the other.

The back needs a mark. Seen from above, a body is an oval, the same from the front as from behind. The blue row at the back of two of the body drawings is a backpack, and it is what tells you she has turned around.

Here are the nine drawings as text, with an empty line between them:

...........
...........
...........
...........
...kk.kk...
...kk.kk...
...kk.kk...
...........
...........
...........
...........

...........
...........
...........
...........
...bb.bb...
...bb.bb...
...........
...........
...........
...........
...........

...........
...........
...........
...ccccc...
..ccccccc..
..ccccccc..
...ccccc...
...........
...........
...........
...........

...........
...........
...bbbbb...
...ccccc...
.ycccccccy.
.ycccccccy.
...ccccc...
...........
...........
...........
...........

...........
...........
...bbbbb...
...ccccc...
.ccccccccc.
.ccccccccc.
...ccccc...
...........
...........
...........
...........

...........
...........
...........
...ccccc...
.ccccccccc.
.ccccccccc.
...ccccc...
...........
...........
...........
...........

...........
...........
...........
....sss....
...sssss...
...sssss...
...skkks...
...........
...........
...........
...........

...........
...........
...ooooo...
..ooooooo..
..ooooooo..
..ooooooo..
..ooooooo..
...ooooo...
...........
...........
...........

...........
...........
...........
....yyy....
...yyyyy...
...yyyyy...
....yyy....
...........
...........
...........
...........

How many layers each drawing is used for, in the same order: 2, 3, 1, 1, 3, 1, 3, 1, 2.

What does the check say?

The recipe Sprite stack looks at the layers before it piles them. For the beekeeper it says:

17 layers of 11 by 11 pixels. No problems.

To see it fail, we cut the first column off the head drawing. That drawing is used for three layers, so the check finds it three times:

17 layers of 11 by 11 pixels. Found 3 things to look at.
layer-size: Layer 12 is 10 by 11 pixels, layer 1 is 11 by 11. Layers of different sizes do not sit on top of each other.
layer-size: Layer 13 is 10 by 11 pixels, layer 1 is 11 by 11. Layers of different sizes do not sit on top of each other.
layer-size: Layer 14 is 10 by 11 pixels, layer 1 is 11 by 11. Layers of different sizes do not sit on top of each other.

The recipe then refuses to draw the figure, because layers of different sizes turn around different middles.

Why does the sheet check complain about her feet?

We ran our own sprite sheet check over the eight pictures, as we would over any sheet. It reported one problem:

Sheet of 168 by 37 pixels: 8 frames of 21 by 37.
See-through pixels: 5352. Partly see-through: 0. Colours: 6.
Found 1 problem.
foot-line: The feet are not on one line: frame 1 stands on row 28, frame 5 stands on row 28, the others on row 29. The figure bobs up and down while it plays.

This time the check measures the wrong thing, and the figure is right. Her two boots side by side are five pixels wide and three deep. Seen from the side, the boot nearer to the viewer reaches one pixel further down the screen than the boots do from the front. A lowest pixel that changes with the direction is what a solid figure looks like from a slanted camera.

It matters for how you place her. Put a turning figure into the game by the point it turns around, never by its lowest pixel, or it hops a pixel as it turns. The recipe names that point: in every one of her pictures, which are 21 by 37 pixels, it is column 11, row 27.

The pixel art beekeeper turning on the spot in sixteen steps.
Sixteen directions from the same nine drawings.

What is it good for, and what not?

  • It suits chunky things seen from above at a slant: figures like this one, cars, boats, crates.
  • It does not draw fine detail on the sides. A face in profile or lettering on a door does not survive being a strip one pixel high.
  • Give the layers an odd size. At 11 by 11, one pixel is exactly in the middle, and it stays put while the figure turns. With an even size no pixel is in the middle, the figure shifts by up to a pixel between directions, and the check tells you so.
  • Walking is extra work. The pile turns. It does not move its legs. For a walk you swap two or three versions of the lowest drawings, or let the whole figure bob.
  • One number sets the camera. It says how far each layer is lifted above the one below. One pixel gives the view on this page. Less makes the figure flatter, as if seen from higher up.

The technique is known as sprite stacking. The editor SpriteStack calls it "drawing a model slice by slice".

Paste this to your AI

I need my [character / vehicle / prop] to face [8] directions in my
top-down game. Build it as a sprite stack.

1. First describe the figure to me as layers from the ground up, in
   words: what each layer shows from above, how many layers high it is,
   what marks the front and what marks the back. Wait for my yes.
2. Take the code "Sprite stack" from
   https://spielerando.com/en/recipes/sprite-stack and "Pixel art from
   text" from https://spielerando.com/en/recipes/pixel-art-from-text.
   Run their tests first and show me that they pass.
3. Write each layer as rows of letters, all of one odd size. The bottom
   row of a layer is the side that faces me.
4. Run checkStack and show me its report as it is printed. Fix what it
   finds and run it again.
5. Show me the figure from all [8] directions in one row, scaled up 6
   times, and tell me the point that groundPoint gives.
6. In the game, place the figure by that point, not by its lowest pixel.

How to check it worked

  • Find the front and the back without being told. If you cannot, the figure needs a clearer mark on one of them.
  • Flip through the directions in order. The figure should turn on the spot and not hop.
  • Compare the sizes. Every picture must have the same width and height.
  • Change one layer and make the pictures again. Recolour the hat, say. Every direction must show the change, because they all come from that layer.
  • Look at the quarter turn. It is the same figure seen from the side, with nothing stretched.

Was this page helpful?

One click, no account. It shows us which pages help.

Next step

Cookbook

A Walk Cycle Without Drawn Frames, and Feet That Stay Put

The stacked beekeeper turns on the spot and her legs never move; this page gives a figure a walk from a rule, with feet that stay where they stand.

Sources

Last updated: 2026-11-26