From be374c6237e3918b97e0d256e28a3f05272bf59e Mon Sep 17 00:00:00 2001 From: NovaFarma Dev Date: Mon, 15 Dec 2025 19:43:26 +0100 Subject: [PATCH] Art: Made all trees 40% smaller + apple tree simple 2D flat style --- src/scenes/GameScene.js | 1 + src/systems/ChunkManager.js | 5 +-- src/systems/Flat2DTerrainSystem.js | 57 +++++++++++++----------------- src/systems/LakeSystem.js | 2 +- src/systems/RiverSystem.js | 2 +- src/systems/TransitionSystem.js | 25 +++++++------ 6 files changed, 46 insertions(+), 46 deletions(-) diff --git a/src/scenes/GameScene.js b/src/scenes/GameScene.js index 194f28c..365004a 100644 --- a/src/scenes/GameScene.js +++ b/src/scenes/GameScene.js @@ -82,6 +82,7 @@ class GameScene extends Phaser.Scene { console.log('💾 Initializing Chunk Manager...'); this.chunkManager = new ChunkManager(this, 50); // 50x50 chunks + this.chunkManager.biomeSystem = this.biomeSystem; // Connect biomeSystem! console.log('✅ Chunk Manager ready!'); // 🌈 PHASE 28: TRANSITION SYSTEM diff --git a/src/systems/ChunkManager.js b/src/systems/ChunkManager.js index 2393e9e..8862e51 100644 --- a/src/systems/ChunkManager.js +++ b/src/systems/ChunkManager.js @@ -3,6 +3,7 @@ class ChunkManager { constructor(scene, chunkSize = 50) { this.scene = scene; this.chunkSize = chunkSize; // 50x50 tiles per chunk + this.biomeSystem = null; // Will be set by GameScene // Active chunks (currently loaded) this.activeChunks = new Map(); // Key: "chunkX,chunkY", Value: chunk data @@ -67,8 +68,8 @@ class ChunkManager { // Get biome for this tile let biomeId = 'grassland'; - if (this.scene.biomeSystem) { - biomeId = this.scene.biomeSystem.getBiomeAt(worldX, worldY); + if (this.biomeSystem) { + biomeId = this.biomeSystem.getBiomeAt(worldX, worldY); } chunk.tiles.push({ diff --git a/src/systems/Flat2DTerrainSystem.js b/src/systems/Flat2DTerrainSystem.js index 9091508..e7e8efc 100644 --- a/src/systems/Flat2DTerrainSystem.js +++ b/src/systems/Flat2DTerrainSystem.js @@ -684,7 +684,7 @@ class Flat2DTerrainSystem { // 🌸 PNG SPRITE! if (this.scene.textures.exists('tree_cherry')) { const tree = this.scene.add.image(x, y, 'tree_cherry'); - const scale = Phaser.Math.FloatBetween(0.4, 0.6); // SMALLER! (was 0.8-1.2) + const scale = Phaser.Math.FloatBetween(0.25, 0.4); // Even SMALLER! (was 0.8-1.2) tree.setScale(scale); tree.setOrigin(0.5, 0.85); @@ -749,7 +749,7 @@ class Flat2DTerrainSystem { // 🌲 PNG SPRITE! if (this.scene.textures.exists('tree_oak')) { const tree = this.scene.add.image(x, y, 'tree_oak'); - const scale = Phaser.Math.FloatBetween(0.45, 0.65); // SMALLER! + const scale = Phaser.Math.FloatBetween(0.28, 0.42); // Even SMALLER! tree.setScale(scale); tree.setOrigin(0.5, 0.85); const shadow = this.scene.add.ellipse(x, y + 15, 35 * scale, 12, 0x000000, 0.2); @@ -788,7 +788,7 @@ class Flat2DTerrainSystem { // 🌲 PNG SPRITE! if (this.scene.textures.exists('tree_pine')) { const tree = this.scene.add.image(x, y, 'tree_pine'); - const scale = Phaser.Math.FloatBetween(0.45, 0.7); // SMALLER! + const scale = Phaser.Math.FloatBetween(0.28, 0.45); // Even SMALLER! tree.setScale(scale); tree.setOrigin(0.5, 0.9); // Taller const shadow = this.scene.add.ellipse(x, y + 20, 30 * scale, 10, 0x000000, 0.2); @@ -872,44 +872,37 @@ class Flat2DTerrainSystem { } createAppleTree(x, y) { - // 🍎 PNG SPRITE! - if (this.scene.textures.exists('tree_apple')) { - const tree = this.scene.add.image(x, y, 'tree_apple'); - const scale = Phaser.Math.FloatBetween(0.4, 0.6); // SMALLER! - tree.setScale(scale); - tree.setOrigin(0.5, 0.85); - const shadow = this.scene.add.ellipse(x, y + 16, 32 * scale, 11, 0x000000, 0.2); - shadow.setDepth(tree.depth - 1); - return tree; - } - - // FALLBACK: + // 🍎 2D FLAT STYLE - Smaller and simpler! const graphics = this.scene.add.graphics(); - const growthScale = Phaser.Math.FloatBetween(0.8, 1.3); // BIGGER! + const scale = 0.6; // Much smaller! // Shadow graphics.fillStyle(0x000000, 0.15); - graphics.fillEllipse(x, y + 22, 22 * growthScale, 7); + graphics.fillEllipse(x, y + 14, 18 * scale, 6); - // Trunk - graphics.fillStyle(0x8B4513); - graphics.fillRect(x - 4 * growthScale, y + 2, 8 * growthScale, 20 * growthScale); + // Trunk (simple rectangle) + graphics.fillStyle(0x6d4c41); // Brown + graphics.fillRect(x - 3 * scale, y - 2, 6 * scale, 16 * scale); - // Green crown - graphics.fillStyle(0x3CB371); // Medium sea green - graphics.fillCircle(x, y - 8 * growthScale, 16 * growthScale); + // Crown - simple rounded shape (2D style!) + graphics.fillStyle(0x4a9d5f); // Green + graphics.fillCircle(x, y - 10 * scale, 12 * scale); - // Apples (red circles) - graphics.fillStyle(0xFF0000); - const applePositions = [ - { x: -8, y: -12 }, { x: 5, y: -10 }, { x: -3, y: -5 }, - { x: 8, y: -8 }, { x: 0, y: -15 } + // Secondary crown circles for volume (Stardew style) + graphics.fillCircle(x - 6 * scale, y - 8 * scale, 9 * scale); + graphics.fillCircle(x + 6 * scale, y - 8 * scale, 9 * scale); + + // Apples (simple red dots) + graphics.fillStyle(0xFF3333); + const apples = [ + { x: -5, y: -12 }, { x: 4, y: -10 }, + { x: 0, y: -8 }, { x: 6, y: -9 } ]; - applePositions.forEach(pos => { + apples.forEach(pos => { graphics.fillCircle( - x + pos.x * growthScale, - y + pos.y * growthScale, - 3 * growthScale + x + pos.x * scale, + y + pos.y * scale, + 2.5 * scale ); }); diff --git a/src/systems/LakeSystem.js b/src/systems/LakeSystem.js index a3ba91e..5ec60e7 100644 --- a/src/systems/LakeSystem.js +++ b/src/systems/LakeSystem.js @@ -7,7 +7,7 @@ * - Connects to river system */ -export default class LakeSystem { +class LakeSystem { constructor(worldWidth, worldHeight, biomeSystem) { this.worldWidth = worldWidth; this.worldHeight = worldHeight; diff --git a/src/systems/RiverSystem.js b/src/systems/RiverSystem.js index 38a36ff..49f8fdf 100644 --- a/src/systems/RiverSystem.js +++ b/src/systems/RiverSystem.js @@ -6,7 +6,7 @@ * - Biome-aware water coloring */ -export default class RiverSystem { +class RiverSystem { constructor(worldWidth, worldHeight, biomeSystem) { this.worldWidth = worldWidth; this.worldHeight = worldHeight; diff --git a/src/systems/TransitionSystem.js b/src/systems/TransitionSystem.js index 0294a7a..ef86fe5 100644 --- a/src/systems/TransitionSystem.js +++ b/src/systems/TransitionSystem.js @@ -174,26 +174,31 @@ class TransitionSystem { // Get features for a specific biome getBiomeFeatures(biomeId, x, y) { - // Temporarily set biome to get its features - const originalBiome = this.biomeSystem.getBiomeAt(x, y); - - // This is a bit hacky - we'd need to refactor BiomeSystem to support this better - // For now, just return features based on biome type - const features = []; const biomeData = this.biomeSystem.biomes[biomeId]; - if (!biomeData) return features; + if (!biomeData || !biomeData.features) return features; - // Check spawn probability - if (Math.random() < biomeData.spawnProbability.trees) { + // Check spawn probability for trees + if (biomeData.features.trees && Math.random() < biomeData.features.trees) { features.push({ type: 'tree', size: 'medium' }); } - if (Math.random() < biomeData.spawnProbability.rocks) { + // Check spawn probability for rocks + if (biomeData.features.rocks && Math.random() < biomeData.features.rocks) { features.push({ type: 'rock', size: 'small' }); } + // Desert-specific features + if (biomeData.features.cacti && Math.random() < biomeData.features.cacti) { + features.push({ type: 'cactus' }); + } + + // Mountain-specific features + if (biomeData.features.largeRocks && Math.random() < biomeData.features.largeRocks) { + features.push({ type: 'boulder' }); + } + return features; }