Fix Biome System integration, memory optimization, and Tiled live sync workflow
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user