tilemaps

Featured

Use this skill when working with tilemaps in Phaser 4. Covers loading Tiled JSON maps, creating tilemap layers, tile collision, dynamic tiles, tile properties, and tilemap camera culling. Triggers on: Tilemap, Tiled, tilemap layer, tile collision, tile properties.

AI & Automation 957 stars 79 forks Updated today MIT

Install

View on GitHub

Quality Score: 93/100

Stars 20%
99
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Tilemaps > Phaser Tilemaps render tile-based levels from Tiled JSON, CSV, or raw 2D arrays. A `Tilemap` holds parsed map data and provides methods to add tilesets, create layers, set collision, and query tiles. Layers (`TilemapLayer` or `TilemapGPULayer`) are the Game Objects that actually render tiles. Phaser supports orthogonal, isometric, hexagonal, and staggered maps. **Key source paths:** `src/tilemaps/Tilemap.js`, `src/tilemaps/TilemapLayer.js`, `src/tilemaps/TilemapGPULayer.js`, `src/tilemaps/TilemapLayerBase.js`, `src/tilemaps/Tile.js`, `src/tilemaps/Tileset.js`, `src/tilemaps/TilemapFactory.js`, `src/tilemaps/components/`, `src/tilemaps/parsers/tiled/` **Related skills:** ../loading-assets/SKILL.md, ../sprites-and-images/SKILL.md ## Quick Start ```js class GameScene extends Phaser.Scene { preload() { // Load the Tiled JSON and the tileset image this.load.tilemapTiledJSON('map', 'assets/level1.json'); this.load.image('tiles', 'assets/tilesheet.png'); } create() { // Create the tilemap from cached JSON const map = this.add.tilemap('map'); // Link the tileset image to the tileset name used in Tiled const tileset = map.addTilesetImage('tilesheet', 'tiles'); // Create a layer - layerID must match the layer name in Tiled const ground = map.createLayer('Ground', tileset); // Enable collision on specific tile indexes ground.setCollision([1, 2, 3]); } } ``` The fl...

Details

Author
autonomous-ai
Repository
autonomous-ai/openharness
Created
1 months ago
Last Updated
today
Language
C
License
MIT

Similar Skills

Semantically similar based on skill content — not just same category