---
title: "Build a tile map: paint levels with tiles and terrain"
description: "Build a game level from your tileset. Paint with tiles and terrain brushes, add layers, automate details with rules and export the map to Godot or Tiled."
source: https://makepixel.ai/guide/build-a-tile-map/
language: en
updated: 2026-11-25
---

# Build a tile map: paint levels with tiles and terrain

A **tile map** is a game level built on a grid, where each cell shows one tile from your tileset. This guide takes you from an empty map to a layered level you can export to your engine, using the brushes, terrain tools and rules in the MakePixel map editor.

## Create a map

There are three ways in, depending on what you already have.

**From a tileset (quickest).** Right-click a tileset on the canvas and choose **New map**. The map is created and opened straight away.

**From scratch.** Press N and choose **Map**.

1. Set the **Tile size**. It must match your tileset.
2. Set the **Map size** in tiles. The default is 40 × 30, and each side can go up to 1024.
3. Under **Tileset**, pick one from your project, start a new one from a template, or choose **None**.
4. Select **Create**.

If the project has no tileset yet, one is created with the map, so you can start painting right away.

**From a finished image.** Right-click a picture of a level and choose **Convert to map…**. Set the **Tile size** and MakePixel splits the image into a tileset and a map, reusing identical tiles. **Match flipped tiles** also merges tiles that are flips or rotations of each other, which often shrinks the tileset a lot. The original image stays untouched.

To reopen a map later, double-click it, or select it and press Enter. Esc steps back out.

MakePixel maps are orthogonal, with square tiles and a fixed size. Isometric, hexagonal and infinite maps aren't supported.

## Get around the editor

The tools are on the left, their options along the top, and **Layers** and your **Tilesets** on the right. If you've used the pixel editor, the keys are the same.

| Tool | Key | | Tool | Key |
| --- | --- | --- | --- | --- |
| Brush | B | | Rectangle select | M |
| Eraser | E | | Magic wand | W |
| Eyedropper | I | | Random | D |
| Bucket | G | | Flip | X, Y |
| Rectangle | U | | Rotate | Z, ⇧Z |
| Ellipse | ⇧U | | Hand | H |

Toggle the grid with ⌘⇧' (Ctrl on Windows and Linux).

## Place tiles

1. Click a tile in the palette under **Tiles**.
2. With the **Brush**, drag on the map. A faint preview shows what you're about to place.

Each stroke is one undo step. Hold Shift and click to draw a straight line from your last stroke.

**Use several tiles as a stamp.** Drag across tiles in the palette to pick a block, like a whole tree or a house. The brush then places them together.

**Copy from the map.** Hold Alt or the right mouse button: click to pick up a tile, or **drag to pick up a whole area** as a stamp. It's the fastest way to reuse something you've already arranged.

## Paint with terrain

Placing corners and edges by hand is slow. If your tileset has terrains, use them instead.

1. Click a **terrain swatch** above **Tiles**.
2. Paint with **Brush**, **Bucket**, **Rectangle** or **Ellipse**.

The borders and corners appear as you go. The eraser tidies them up when you remove part of a shape, and clicking any tile takes you back to normal placement.

If no tile fits a spot, the brush uses the closest one and flashes a red outline there, so you know the tileset is missing a piece. Tilesets made from a template have terrain ready to go.

## Fill large areas

- **Bucket** fills a connected region. Switch it from **Contiguous** to **Global** to replace every matching cell on the layer.
- **Rectangle** and **Ellipse** share a tool button. Click it again to switch. Hold Shift for a square or circle, and Alt to draw from the centre.

All of these work with a stamp or a terrain, and a selection limits them to the area inside it.

## Break up repetition

A field made from one tile looks like wallpaper.

**Random.** Select a few similar tiles in the palette and press D. Each cell now picks one of them. To make some tiles rarer, right-click a tile, open **Tile properties** and, under **Advanced**, lower its **Probability**. A value of 0 means it's never picked.

**Flip and rotate.** Press X or Y to flip the stamp, and Z or ⇧Z to rotate it. One rock becomes four. These don't apply to the terrain brush.

## Select, copy and move

The **Rectangle select** (M) and **Magic wand** (W) tools pick cells. Hold Shift to add, Alt to subtract, or both to intersect. The wand's **Global** option selects every copy of a tile on the layer.

Copying works a little differently from a drawing app:

- **⌘C** turns the selection into your **current stamp** and switches to the Brush. Click wherever you want it.
- **⌘X** does the same and clears the original cells.
- **Delete** clears the selection.

There's no floating selection to drag around, and cells can't be pasted between browser tabs.

## Organise with layers

Layers let you build a level in depth, and keep the ground separate from the things on it. A common stack, from bottom to top:

| Layer | Holds |
| --- | --- |
| **Ground** | Grass, floors, water |
| **Detail** | Flowers, cracks, paths |
| **Walls** | Anything solid |
| **Overhead** | Treetops and roofs that the player walks behind |
| **Objects** | Spawn points, triggers and enemies |

Add a tile layer with **+** in **Layers**, or use the **⌄** beside it (**Add layer…**) to choose **Tile layer**, **Auto layer** or **Object layer**.

Each row has eye and lock buttons, and a `…` menu for **Rename**, **Opacity**, **Duplicate layer**, moving and **Delete**. **Highlight current layer** in **Map options** dims the others while you work. A map can have up to 64 layers, and one layer can mix tiles from several tilesets.

## Automate details with rules

Wall tops, shadows and scattered flowers have to be redone every time you change a level, unless a rule places them. An **Auto layer** watches another tile layer and places tiles by rule, so the decoration updates as you paint. If you've used LDtk's auto-layers or Tiled's Automapping, this is the same idea.

**Scatter flowers on grass:**

1. On your ground layer, open **⌄** and choose **Auto layer**. A **Scatter** rule opens, ready to edit.
2. In the dropdown under the pattern grid, choose what the flowers grow on, such as **Terrain: Grass**, then click the grid's centre cell so it uses that match.
3. Select your flower tiles in the palette and choose **Use selected tiles**.
4. Set **Chance** to about 10%. Select **Shuffle** to try a different scatter.

Now paint more grass on the ground layer, and flowers grow on it.

**More starting points**, from **Add rule**:

- **Edge** places a tile on cells with something different above them. Use it for grass tops and wall caps.
- **Below** places a tile just under a shape. Use it for shadows under walls and ledges.
- **Custom** gives you a 3 × 3 pattern with only its centre cell set.

**How rules are read.** Each cell tries the rules from top to bottom, and you can drag a rule to reorder it. In the pattern grid, click a cell to cycle through **Is**, **Not** and **Anything**, using whatever the dropdown has picked. With **Stop on match** on, the first rule that fires ends the search for that cell. A rule that fails its **Chance** doesn't count as a match, so "10% flowers, otherwise plain grass" takes just two rules.

The scatter is tied to each cell's position on the map, so editing one area won't reshuffle the others, even if you extend the map to the left or top.

Auto layers can't be painted on directly. The **Made from** chip above the map jumps to the source layer. To turn the result into ordinary tiles, use **Convert to tile layer**.

## Resize the map

Open **Map options** and choose **Map size…**. Set the new width and height, and pick an **Anchor** to decide which side grows or shrinks. The preview darkens anything that will be cut and tells you how many tiles you'd lose.

The brush doesn't grow the map when you paint past the edge, so resize first.

## Bring in a Tiled or LDtk map

Drag the files onto the canvas, all together.

- **Tiled:** `.tmx`, `.tmj`, `.tsx` and `.tsj`. If an image is missing, you can add it or import anyway and keep the map's cells.
- **LDtk:** `.ldtk` and `.ldtkl`. Each level becomes a map, and entities become objects. The tiles that LDtk's rules placed come in, but the rules themselves don't.

Afterwards, a notice lists anything that couldn't be imported, like image layers and text objects. Only orthogonal maps with square tiles are supported.

## Export your map

Press ⌘E in the map editor, or right-click the map on the canvas and choose **Export**.

| Target | What you get |
| --- | --- |
| **Godot** (4.3+) | A `.tscn` scene and a `.tres` tileset, one TileMapLayer per tile layer, with collision and custom data. See the [Godot export guide](https://makepixel.ai/guide/export-to-godot/) |
| **Tiled** | A map in **TMX** or **JSON** format |
| **PNG** | The whole map as one image, up to 8192 × 8192 pixels |

Auto layers are written as ordinary tile layers. For **Unity**, export to Tiled and import it with SuperTiled2Unity. Maps can't be exported to LDtk, RPG Maker or GameMaker.

## Common problems

**I can't paint on this layer.** It's hidden, locked or an Auto layer. An Object layer takes object tools instead.

**My tileset isn't in the list.** The palette only offers tilesets with the same tile size as the map.

**Painted terrain has a red flash.** The tileset lacks a tile for that shape. Add one, or mark an existing one in **Terrains**.

**Paste doesn't drop anything.** Pasting here is painting. After ⌘C, click on the map with the Brush.

**I changed a tile and my map changed too.** That's by design. Maps use the live tileset, so a fix to one tile reaches every map that uses it.

## Next steps

Your level is ready for collision and spawn points. See the [tilesets and maps overview](https://makepixel.ai/features/tilesets-and-maps/) for everything the editor can do, or take the level into your game with the [Godot export guide](https://makepixel.ai/guide/export-to-godot/).
