← PathwayLesson 2 · Sprite Sheets & AnimationNext lesson →

Lesson 02 · 60 minutes · Art layer

Motion is a list of drawings and a clock.

An animation is several frames shown one after another. You will draw a run cycle with onion skinning, pack the frames into a sprite sheet, and find out how frame rate changes the feel.

FRAMESRUN CYCLEONION SKINSPRITE SHEETSOURCE RECTFPS
01 / WHY

Where this comes from

Flip books, then sheets of frames.

1980s

Consoles stored animation frames side by side in memory and the program pointed at a different frame each few screen refreshes. That “sheet of frames + pointer” idea is still exactly how a modern sprite sheet works.

Contact pose

Legs spread, one foot touching down. The widest, most readable pose in a run.

Passing pose

Legs together, body raised one pixel. Alternating the two gives a bounce.

Holds

Idle can be 2 frames at 2 fps. A blink every few seconds makes a character feel alive.

Fewer, better frames

Four strong run frames beat eight muddy ones. Timing matters more than frame count.

4-Pose Run Cycle Anatomy and Sprite Sheet Slicing Diagram showing Contact and Passing poses with 1px bounce
Run Cycle Anatomy & Sprite Sheet Slicing: Four key poses (Contact → Passing/Down → Contact → Passing/Up) create weight and stride. A 1-pixel vertical torso bounce simulates gravity, while sprite sheet slicing extracts each frame via x = frameIndex × 16.
02 / ANIMATE

Animation lab

Animate your courier.

  1. Pick “run”.The starter has contact → passing → contact → passing.
  2. Edit one frame at a time.The faint image is the previous frame (onion skin). Change only what should move.
  3. Tune the clock.Try 6, 10 and 16 fps. Which looks like jogging, running, panicking?
  4. Check jump, fall and land.One strong frame each is enough; the game picks them in lesson 08.

Courier animationsFrames + fps save automatically

03 / THEORY

Theory: sheets and source rectangles

The game copies one rectangle out of one image.

A sprite sheet is one image holding every frame. To draw frame i, the game copies the source rectangle at x = i × 16 and pastes it at the player’s position. One image means one file to load and one texture for the graphics card.

frame timing · JavaScript
let time = 0;                    // seconds since the animation started
function drawPlayer(dt) {
  time += dt;
  const frame = Math.floor(time * anim.fps) % anim.frames;  // 0, 1, 2, 3, 0, 1…
  ctx.drawImage(sheet,
    frame * 16, 0, 16, 16,         // source: which frame on the sheet
    player.x, player.y, 16, 16);   // destination: where on screen
}
Clock rulePick the frame from elapsed time, not from how many screen refreshes happened. Otherwise the run cycle plays twice as fast on a 120 Hz screen.
A 4-frame run cycle at 10 fps. How long does one full loop take?

04 / ENGINES

Same idea, other tools

Every engine slices a sheet the same way.

Remix challenge

Add a fifth run frame and set the cycle to 12 fps. Did it get smoother, or just slower? Explain using frames × milliseconds.

05 / SHIP

Definition of done

Your animation set is ready when…

0/4 checked

Evidence: Record or show the run cycle at two frame rates and explain which matches your courier’s personality.

Lesson 02 complete?

Your art and settings are already saved for the next lesson.