This commit is contained in:
2025-12-12 00:13:55 +01:00
parent 158beec572
commit e15b429e75
17 changed files with 482 additions and 202 deletions

View File

@@ -208,14 +208,19 @@ class GameScene extends Phaser.Scene {
this.signposts = [];
// Path markers (using fence sprites as signposts)
const pathMarkers = [
{ x: 35, y: 35, label: '→ City' },
{ x: 50, y: 50, label: '← Farm' },
];
// ONLY if terrainSystem was successfully initialized
if (this.terrainSystem) {
const pathMarkers = [
{ x: 35, y: 35, label: '→ City' },
{ x: 50, y: 50, label: '← Farm' },
];
for (const marker of pathMarkers) {
this.terrainSystem.addDecoration(marker.x, marker.y, 'fence');
this.signposts.push({ gridX: marker.x, gridY: marker.y, label: marker.label });
for (const marker of pathMarkers) {
this.terrainSystem.addDecoration(marker.x, marker.y, 'fence');
this.signposts.push({ gridX: marker.x, gridY: marker.y, label: marker.label });
}
} else {
console.warn('⚠️ TerrainSystem not initialized - skipping signposts');
}
// Kamera sledi igralcu z gladko interpolacijo (lerp 0.1)
@@ -280,8 +285,8 @@ class GameScene extends Phaser.Scene {
// Initialize Save System
this.saveSystem = new SaveSystem(this);
// Auto-load if available
this.saveSystem.loadGame();
// Auto-load if available (DISABLED in SaveSystem!)
this.saveSystem.loadGame(); // Vrne false - ne naloži save-a!
// Debug Text
this.add.text(10, 10, 'NovaFarma Alpha v0.6', { font: '16px monospace', fill: '#ffffff' })
@@ -738,11 +743,11 @@ class GameScene extends Phaser.Scene {
if (this.terrainSystem.decorationsMap.has(key)) {
this.terrainSystem.removeDecoration(x, y);
}
// Make it grass or dirt - USE CORRECT TERRAIN TYPE OBJECT
// Make it DIRT for farming
if (this.terrainSystem.tiles[y] && this.terrainSystem.tiles[y][x]) {
this.terrainSystem.tiles[y][x].type = this.terrainSystem.terrainTypes.GRASS_FULL;
this.terrainSystem.tiles[y][x].type = 'dirt';
if (this.terrainSystem.tiles[y][x].sprite) {
this.terrainSystem.tiles[y][x].sprite.setTexture('grass');
this.terrainSystem.tiles[y][x].sprite.setTexture('dirt');
this.terrainSystem.tiles[y][x].sprite.setTint(0xffffff); // Clear tint
}
}