godot-tilemaplayer
Installation
SKILL.md
TileMapLayer (Godot 4.3+)
Godot 4.3 added the TileMapLayer node and deprecated TileMap. Each TileMapLayer is one layer, so a level with ground, walls and decoration is three sibling TileMapLayer nodes sharing one TileSet. Do not write new code against TileMap, and never use the Godot 3 API (set_cellv, world_to_map, set_cell(x, y, tile_id)).
The cell API
A cell is identified by integer map coordinates (Vector2i). A tile is identified by three values:
source_id: the ID of a source in theTileSet(an atlas texture or a scenes collection). The first atlas is usually0; check the TileSet editor or the return value ofTileSet.add_source().atlas_coords: the tile's column and row inside that atlas, in tiles, not pixels.alternative_tile:0unless you made flipped or rotated alternatives.
extends TileMapLayer
const SOURCE_ID := 0
const GRASS := Vector2i(0, 0)
const WALL := Vector2i(1, 0)