Topics / Building a game

2D graphics

Sprite sheet and texture atlas

A sprite sheet packs the frames of one animation into a single image. A texture atlas packs many different sprites into one image. Both exist so the game loads one file and draws from it instead of juggling hundreds.

Watch: see it in 30 seconds

Video coming soon
A 30-second visual explanation

Why it matters for your game

  • Loading one big image is far faster than loading three hundred small ones, especially in a browser. Your AI will suggest an atlas once the game has more than a few dozen sprites.
  • The game needs a map of where each sprite sits inside the sheet (a JSON file). Tools generate it; you do not hand-write it.
  • If an animation plays the wrong frames, the sheet's frame size or order is usually wrong, not the code.

How it comes up when you talk to your AI

  • 'Pack the sprites into an atlas', 'frame width and height', 'the atlas JSON'.
  • Our village game bakes each villager's eight directions into one sheet, so a direction change is just a different row of the same image.

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.

Explain sprite sheets versus texture atlases for a 2D browser game, why they make loading faster, and what tool you would use to pack them. Show how the game code looks up one frame inside the sheet.

Related terms