뒤로
· 2분 읽기
Tile maps
Tile collision as one voxel shape, autotiling from an ordered rule table, animated and light-blocking tiles, isometric and hex, and Tiled import.
- Dragos Balaur
Tile maps get collision as one voxel shape, autotiling from an ordered rule table, animated and light-blocking tiles, isometric and hex layouts, a Tiles dock, and Tiled import.

- The tileset marks solid tiles, and
tile_collisionon the map builds one parry voxel shape from them. Slopes are polygons in tile pixels,one_way = truemakes a platform, and afterset_cellthe collider is rebuilt once on the next fixed step. - Autotiling is one table of
[[rules]], first match wins.transformscovers eight orientations per rule, so a 47-tile blob is a dozen rules.outsidesays whether the map edge counts as the same terrain, and variation is hashed from the cell's coordinate.mode = "sides"or"corners_and_sides"writes the rules from a bitmask sheet. animation = { frames, fps }runs on the frame clock, outside the digest.occluder = truefeeds the 2D light map only the exposed edges, so fifty tiles cast one shadow.- Cell
0,0has its top-left corner on the node and the map keeps anorigin. - The Tiles dock paints, fills, draws rectangles and lines, and picks. It has a terrain brush through the engine's own resolver, and a Set panel that writes solid, one-way or occluder back to the tileset file.
layout = "isometric"or"hex"goes on the tileset. Mesh, collider, picking and painter share one placement function.balaur import level.tmx --project gamewrites the atlas, atilesetper sheet (grid, spacing, margin, per-tile collision, animations) and a scene with onetilemapnode per layer.
[tiles.0]
collision = "full"
[tiles.7]
collision = [[[0, 16], [16, 16], [16, 8]]] # a slope, in tile pixels
one_way = true
[tiles.14]
animation = { frames = [14, 15, 16], fps = 8 }
[tiles.3]
occluder = true
[[rules]]
terrain = "grass"
pattern = ["?#?", # ? any # this terrain . anything else
"?#.",
"?##"]
tile = 12
transforms = ["rotate", "mirror"]
outside = "same"
Quarter-tile sheets, LDtk import, chunked cell files and the multi-tile
stamp came with it. Roadmap,
plan.
tilemap and tile_collision are in the
components reference.