feat: Complete Tiled Setup & Auto-Sync Workflow [GOAT MODE]
- Added Faza1_Finalna.tmx/json with embedded tilesets - Configured Auto-Sync Watcher (tiled-watcher.js) - Fixed GameScene.js loop to properly render Tiled layers - Updated PreloadScene.js with all tileset assets - Enabled Amnesia Intro and Z-Sorting for Player/Objects - Cleaned up old/unused map files
This commit is contained in:
@@ -167,11 +167,13 @@ class Flat2DTerrainSystem {
|
||||
this.pathsLayer = layer;
|
||||
}
|
||||
else if (lowerName.includes('decor') || lowerName.includes('obstacle') || lowerName.includes('object')) {
|
||||
layer.setDepth(3);
|
||||
// Y-SORTED DEPTH for proper player sorting!
|
||||
// Uses same layer as Player (200000 + Y)
|
||||
layer.setDepth(200000); // Base depth, tiles will sort by Y
|
||||
this.decorLayer = layer;
|
||||
}
|
||||
else if (lowerName.includes('building') || lowerName.includes('structure') || lowerName.includes('fence')) {
|
||||
layer.setDepth(4);
|
||||
layer.setDepth(200000); // Also Y-sorted
|
||||
}
|
||||
else {
|
||||
layer.setDepth(2);
|
||||
@@ -183,13 +185,14 @@ class Flat2DTerrainSystem {
|
||||
// 🗺️ Populate this.tiles from map data (for Pathfinding, Farming, etc.)
|
||||
// We use the 'Ground' layer as the base grid
|
||||
const groundLayerData = map.getLayer('Ground') || map.layers[0];
|
||||
if (groundLayerData && groundLayerData.data) {
|
||||
if (groundLayerData && groundLayerData.data && Array.isArray(groundLayerData.data)) {
|
||||
console.log('📊 Populating terrain tiles grid from Tiled data...');
|
||||
this.tiles = [];
|
||||
for (let y = 0; y < map.height; y++) {
|
||||
this.tiles[y] = [];
|
||||
for (let x = 0; x < map.width; x++) {
|
||||
const tile = groundLayerData.data[y][x];
|
||||
// Safety check: ensure row exists
|
||||
const tile = (groundLayerData.data[y] && groundLayerData.data[y][x]) || null;
|
||||
this.tiles[y][x] = {
|
||||
x: x,
|
||||
y: y,
|
||||
|
||||
Reference in New Issue
Block a user