Fix Biome System integration, memory optimization, and Tiled live sync workflow

This commit is contained in:
2025-12-27 12:50:58 +01:00
parent f8d533465b
commit 43f4b11c87
19 changed files with 1314 additions and 591 deletions

View File

@@ -10,7 +10,8 @@ class Player {
this.offsetX = offsetX;
this.offsetY = offsetY;
this.iso = new IsometricUtils(48, 24);
this.tileSize = (this.scene.terrainSystem && this.scene.terrainSystem.tileSize) || 48;
this.iso = new IsometricUtils(this.tileSize, this.tileSize / 2);
// 🎮 SMOOTH MOVEMENT SYSTEM (Hybrid)
this.moveSpeed = 100; // Normal speed px/s
@@ -116,10 +117,9 @@ class Player {
// Kreira sprite
// 🎨 FLAT 2D (NEW!) - Direct screen conversion
const tileSize = 48;
const screenPos = {
x: Math.round((this.gridX * tileSize) + (tileSize / 2)),
y: Math.round((this.gridY * tileSize) + (tileSize / 2))
x: Math.round((this.gridX * this.tileSize) + (this.tileSize / 2)),
y: Math.round((this.gridY * this.tileSize) + (this.tileSize / 2))
};
this.sprite = this.scene.add.sprite(
screenPos.x + this.offsetX,
@@ -275,9 +275,8 @@ class Player {
const screenPos = { x: this.sprite.x - this.offsetX, y: this.sprite.y - this.offsetY };
// 🎨 FLAT 2D (NEW!) - Direct grid conversion
const tileSize = 48;
this.gridX = Math.floor(screenPos.x / tileSize);
this.gridY = Math.floor(screenPos.y / tileSize);
this.gridX = Math.floor(screenPos.x / this.tileSize);
this.gridY = Math.floor(screenPos.y / this.tileSize);
// Check if moving
const speed = Math.sqrt(this.velocity.x ** 2 + this.velocity.y ** 2);