Topics / Building a game

2D graphics

Sprite

A sprite is a flat picture the game draws on screen: a villager, a tree, a coin. Animation is several sprites shown one after another.

Watch: see it in 30 seconds

Video coming soon
A 30-second visual explanation

Why it matters for your game

  • Every visible thing in a 2D game is a sprite or made of sprites. When your AI says 'I'll add a sprite for the dog', it means a small image file plus the code that places and moves it.
  • Sprites are cheap to draw, so a game can show hundreds at once. In our village game the villagers are sprites baked from 3D models so they stay light in the browser.
  • A sprite sheet is one image holding every frame of an animation; the game shows one frame at a time. Ask for a sheet when you want a walk cycle, not a pile of separate files.

How it comes up when you talk to your AI

  • 'Sprite', 'sprite sheet', 'frame', 'atlas' (a sheet holding many unrelated sprites to save loading time).
  • Your AI may ask for the sprite's size in pixels and its anchor (which point of the image sits on the character's position: feet, centre).
  • When something looks blurry or jagged, the question to ask is about scaling and pixel-art filtering, not the sprite itself.

Ask your AI about it

Paste this into the assistant you build with. It is written to get a useful answer for your own project, not a textbook page.

I am building a 2D browser game with you. Explain what a sprite is, what a sprite sheet is, and how an animated walk cycle works. Then tell me what you need from me (image size, frame count, anchor point) to add an animated villager, and show the code for it in the engine we are using.

Related terms