Topics / Building a game

2D graphics

Tilemap

A tilemap builds the ground and walls out of small square tiles repeated on a grid, like a mosaic. The map is a grid of numbers saying which tile goes where.

Watch: see it in 30 seconds

Video coming soon
A 30-second visual explanation

Why it matters for your game

  • It is how a big world stays small: a village of thousands of squares is a few dozen tile images plus a grid of numbers.
  • Changing the map is editing numbers, not images. That is why your AI can 'add a path from the house to the well' with a few lines.
  • Layers (ground, decoration, collision) are separate grids on top of each other; the collision layer is invisible and only says where you cannot walk.

How it comes up when you talk to your AI

  • 'Tile size' (16 or 32 pixels is common), 'tileset' (the image holding all the tiles), 'layers', 'Tiled' (a free map editor whose files most engines read).
  • If characters walk through walls, the collision layer is the first thing to ask about.

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 tilemaps for a 2D game: tiles, tilesets, layers and a collision layer. Tell me how to make a village map for our game and what file format you want me to give you if I draw it in an editor.

Related terms