← Back to the map
Lesson 4

🎨 Sprites & Animation

Sprites & Animation illustration

Your hero can move, jump, and land β€” but it's still a plain red square. πŸŸ₯ Time for the glow-up! In this chapter that square becomes a real little character that walks, faces the right way, and even has a jump pose.

And the secret to making it β€œcome alive” is older than video games β€” it's a flip-book.

1

The big idea: a sprite is a tiny flip-book

A character in a game is just a little picture β€” we call it a sprite. The game draws that picture at the hero's x, y, the same coordinates you learned about earlier.

To make it move, the game keeps a few slightly-different drawings β€” one with the legs together, one mid-stride, and so on β€” and flips between them really fast. Your eyes blur them into smooth walking. That's exactly how a flip-book works, and it's how every animated character in every game is brought to life.

2

Your turn: bring the hero to life

Walk around and watch the legs scissor. Then play with the flip-book below the game, swap the art, and slide the animation speed β€” drag it to 0 to catch the trick.

Click the game, then ← β†’ to walk and ↑ / Space to jump. Watch the legs move!

🎞️ The flip-book

standing still (one frame)
frame 1
frame 2
frame 3
frame 4

These are just 4 drawings. Flip through them fast β†’ it looks like walking.

🎨 Pick the art

Same hero, same moves β€” just a different picture (a different sprite).

⚑ Animation speed

🐒 08 fpsπŸ‡ 16

Each second, the game flips through this many drawings.

β–ΈπŸ”§ Peek inside: drawing the hero is a β€œrecipe”

Every chapter so far has drawn this hero β€” but nobody re-draws it from scratch each time. There's one recipe (programmers call it a function) named drawCharacter that knows how to paint the hero. Each chapter just says β€œrun that recipe here.” Name something once, reuse it everywhere β€” that's how the same hero shows up across your whole game.

🧰 Play with it in the Toolkit β†’
3

Discovery missions

Try each one, tick it off, then peek at the secret.

0/5
  • 🐒Drag the animation speed all the way down to 0, then walk around. What does the hero look like now?

  • ↔️Walk left, then walk right. Watch the hero's face and eyes. What flips?

  • 🎞️Set the speed to about 3–4 and walk slowly. Can you spot each separate frame light up in the flip-book?

  • 🎨Switch the art to Froggy, Robo, or Tiger. Do the moves or the speed change at all?

  • 🦘Jump! The hero strikes a different pose in the air. Why would a game do that?

🌟 You leveled up! You now know:

🎬 Behind the scenes β€” what's next?

Your hero looks alive and can collect coins β€” but right now you can't actually win or lose. It's a fun toy, not yet a game. Next, we add the missing piece: a goal, a score, and a way to win… or get a Game Over. πŸ†πŸ‘‡

πŸ†Next stop Β· Lesson 5Goals, Score & Game Over β†’Add a goal, a score, and a way to win or lose β€” now it's a real game!
← Back to the map