--- description: How to design maps in Tiled Map Editor --- # πŸ—ΊοΈ TILED MAP EDITOR - COMPLETE WORKFLOW ## βœ… Prerequisites (DONE!) - βœ… Tiled installed (winget install Tiled.Tiled) - βœ… Tilesets created (assets/tilesets/) - βœ… Maps directory (assets/maps/) --- ## πŸ“‹ STEP-BY-STEP GUIDE ### **1. Launch Tiled** // turbo ```powershell # Open Tiled from Start Menu or: tiled ``` ### **2. Create New Map** 1. File β†’ New β†’ New Map 2. Settings: - **Orientation:** Orthogonal - **Tile layer format:** Base64 (zlib compressed) - **Tile render order:** Right Down - **Map size:** 100 x 100 tiles - **Tile size:** 48 x 48 pixels 3. Click "Save As" β†’ `assets/maps/farm_map.tmx` ### **3. Import Tilesets** 1. Map β†’ New Tileset 2. For **Grass:** - Name: `grass_tileset` - Type: Based on Tileset Image - Image: `../tilesets/tileset_grass_clean.png` - Tile width/height: 48px - Click OK 3. Repeat for: - `water_tileset` β†’ `tileset_water_pond.png` - `dirt_tileset` β†’ `tileset_dirt_paths.png` - `decorations_tileset` β†’ `tileset_decorations.png` ### **4. Create Layers (in this order!)** 1. Layer β†’ Add Tile Layer β†’ "Ground" (grass base) 2. Layer β†’ Add Tile Layer β†’ "Paths" (dirt & water) 3. Layer β†’ Add Tile Layer β†’ "Decorations" (trees, flowers) 4. Layer β†’ Add Object Layer β†’ "SpawnPoints" ### **5. Design Map** **Ground Layer:** - Fill entire map with grass tiles - Use Paint Bucket tool (hotkey: K) **Paths Layer:** - Add circular pond (center: 60, 45) - Use water tiles in circular pattern - Add dirt paths if desired **Decorations Layer:** - Place cherry blossom trees - Add flowers scattered - Add bushes near trees **SpawnPoints Layer:** - Add Rectangle object - Name: "PlayerSpawn" - Position: x=50 * 48, y=50 * 48 (center) ### **6. Set Tile Properties (for collision)** 1. Select water tiles in tileset panel 2. Right-click β†’ Tile Properties 3. Add Custom Property: - Name: `collides` - Type: bool - Value: true ### **7. Export Map** 1. File β†’ Export As β†’ JSON 2. Save to: `assets/maps/farm_map.json` 3. βœ… This is the file Phaser will load! --- ## 🎨 DESIGN TIPS **Circular Pond:** - Use Ellipse Selection tool - Center at grid (60, 45) - Radius: ~9 tiles - Fill with water tiles **Cherry Trees:** - Scatter in clusters of 3-5 - Leave space between clusters - Place on Decorations layer **Paths:** - Use Freehand tool for organic paths - 1-2 tiles wide - Connect different areas --- ## πŸ”§ PHASER INTEGRATION (Auto-handled!) Map will load in `GameScene.js`: ```javascript this.load.tilemapTiledJSON('farm_map', 'assets/maps/farm_map.json'); this.map = this.make.tilemap({ key: 'farm_map' }); ``` **No code changes needed if you follow this workflow!** --- ## 🎯 FINAL CHECKLIST - [ ] Map created (100x100 tiles) - [ ] 4 tilesets imported - [ ] 4 layers created (Ground, Paths, Decorations, SpawnPoints) - [ ] Pond designed (circular, ~9 tile radius) - [ ] Trees placed (cherry blossom clusters) - [ ] Player spawn point set - [ ] Water tiles have `collides: true` property - [ ] Map exported to `assets/maps/farm_map.json` --- ## πŸ“š Resources - Tiled Docs: https://doc.mapeditor.org/ - Phaser Tilemap Tutorial: https://phaser.io/tutorials/making-your-first-phaser-3-game