All examples · Sprites and 2D · As Markdown, for AIs

A level made in code

What this example shows

A level with no file: createTilemap takes doc, what a .tilemap holds, and atlas, its sheet as an object. Tiles and cells are both generated here, and it is an ordinary map: useTileBody2d walks on it, ledges and ladders are fields of a tile, setTile breaks a brick, and the camera stays inside it.

The robot is half a drawing: mirrorPixels copies its left half onto the right, and outlinePixels draws the border around it, in the room left for it.

Click the preview first so it hears the keyboard. ← → walk, Z jumps, ↑ ↓ climb, X breaks the brick you stand on.

Starting
Starting
—