The flipbook idea
Frame animation works like a flipbook. A character’s walk is drawn as a series of still images, and the game shows them one after another quickly enough that the eye sees movement. Each image is a frame, and a character’s moving image in a 2D game is called a sprite. The method has been used since the earliest video games and is still common in modern 2D titles.
The simplest approach would be to save each frame as its own file. That works, but it scales badly. A character with a dozen animations of several frames each could need dozens or hundreds of separate files. The common solution is the sprite sheet.
What a sprite sheet is
A sprite sheet is a single image containing many frames arranged in a grid or packed layout. Instead of loading dozens of small files, the game loads one image and displays a small rectangle of it at a time. Playing an animation means moving that rectangle from one frame to the next.
Why do this?
- Fewer loads. Reading one image is generally cheaper than reading many.
- Efficient drawing. Graphics hardware tends to handle drawing from one large image more efficiently than switching between many small ones.
- Easier organization. All the frames for a character live together.
A closely related term is a texture atlas, which does the same thing for a mixed collection of images, such as multiple characters, props and interface icons, often packed tightly by software. Sheets laid out in a strict grid are simple to slice, while tightly packed atlases save space but need a data file recording where each frame sits.
Anatomy of a sprite animation
An animation is a list of frames plus timing. Typical pieces include:
- Frame size. In a grid sheet, every frame is usually the same size so the game can slice by position.
- Frame order. The list of frames to play, such as walk-1 through walk-6.
- Frame rate or duration. How long each frame appears. Animations are often played slower than the game’s overall refresh rate. Twelve frames per second is a commonly cited rate for hand-drawn motion, but there is no required value, and many styles use different rates for different actions.
- Looping. Walk and idle cycles repeat, while an attack or a death plays once and stops.
- Pivot or origin. The anchor point of each frame, usually near the feet. A consistent pivot prevents the character from jittering or sliding as frames change.
As a simple check of timing, an animation of 6 frames played at 12 frames per second lasts 0.5 seconds (6 divided by 12). The same 6 frames at 8 frames per second last 0.75 seconds. A longer run time makes the movement feel slower, which is useful when tuning how responsive a move feels.
Animation states
A character does not play one animation forever. The game switches among several: idle, walk, run, jump, fall, attack, hurt. These are managed as states, and rules decide when the character moves between them. For example, pressing the jump button while standing moves from idle to jump, and landing returns to idle. This is closely related to the idea of state machines used for enemy behavior.
Good transitions matter. If the game waits for a walk cycle to finish before starting a jump, the controls feel sluggish. Many developers let key actions interrupt others immediately, or they design frames so that the interruption looks natural. The principles in the discussion of timing and weight apply here as well, even though the medium is drawn frames.
Sprite sheet pitfalls
Bleeding edges. When frames sit right next to each other in a sheet, the graphics hardware can sample a sliver of the neighboring frame at the edges, producing thin lines. Adding a small transparent gap or padding around frames avoids this.
Blurry scaling. If the sprites are pixel art, smoothing filters can blur them. Many engines let you choose a sharp “nearest” sampling mode, which preserves hard edges for pixel art.
Inconsistent frame sizes. If one animation uses a different canvas size, the character appears to shift. Keeping a shared frame size, or storing pivots carefully, avoids it.
Too many frames. More frames mean smoother motion but also more drawing work and more memory. Many appealing 2D animations use surprisingly few frames, with strong key poses and good timing doing most of the work.
Oversized sheets. Graphics hardware has limits on image size, and very large sheets can waste memory. Splitting content by level or character group can help.
Alternatives and complements
Frame-by-frame sprites are not the only way to animate 2D characters. Skeletal animation cuts a character into parts, such as arms and legs, and moves them like a puppet. This needs fewer drawings and blends smoothly, but it has a different look. Many games mix techniques, using drawn frames for the main motion and small code-driven effects for extra polish. Particle effects and similar feedback can be layered on top of a sprite animation without redrawing the frames.
Practical workflow
A typical process looks like this:
- Draw key poses first and test them in the game.
- Add in-between frames until the motion reads.
- Export frames, then pack them into a sheet with a tool, adding padding.
- Import into the engine, set frame size or atlas data, and define the timing.
- Test the animation in the game, adjusting timing and pivots as needed.
For anyone using pixel art, this fits neatly with a fixed grid and small frame size. The concept is simple, but the details of padding, pivots and timing decide whether the animation feels polished.