Phase 37: Micro Farm & Expansion System Complete
MICRO FARM SYSTEM (8x8): - Initial 8x8 farm boundary (center spawn) - White boundary visualization - Corner markers for clear boundaries - Locked tile tracking (Set-based) VISUAL FEEDBACK: - Locked tile overlay (30% black) - Clear visual distinction (farm vs locked) - Dynamic rendering (15 tile radius) - Depth-sorted overlays FARMING RESTRICTIONS: - Block tilling outside farm boundary - Error messages (floating text) - Farm boundary validation - FarmingSystem integration EXPANSION SYSTEM: - 4-direction unlock buttons (N/S/E/W) - Cost system (50 gold per expansion) - 2x2 tile unlock increments - Visual updates (boundaries + overlay) UI INTEGRATION: - Interactive expansion buttons - Hover effects (color + scale) - Cost labels (gold display) - Success/error feedback MINIMAP INTEGRATION: - Farm boundary in minimap - White box indicator - Player-relative rendering - Fixed terrain system compatibility TECHNICAL FIXES: - Added decorationsMap to Flat2DTerrainSystem - Fixed variable scope issues - UIScene minimap compatibility - TerrainSystem.getTile() integration FILES CREATED/MODIFIED: - src/systems/MicroFarmSystem.js (NEW!) - src/systems/FarmingSystem.js - src/systems/Flat2DTerrainSystem.js - src/scenes/GameScene.js - src/scenes/UIScene.js - index.html Session: 1h (00:50-01:19) Date: 15.12.2024 Status: PHASE 37 COMPLETE!
This commit is contained in:
@@ -26,6 +26,22 @@ class FarmingSystem {
|
||||
tillSoil(gridX, gridY) {
|
||||
if (!this.scene.terrainSystem) return false;
|
||||
|
||||
// 🌱 CHECK MICRO FARM BOUNDARY!
|
||||
if (this.scene.microFarmSystem && !this.scene.microFarmSystem.isTileUnlocked(gridX, gridY)) {
|
||||
console.log('❌ Cannot till outside farm boundary!');
|
||||
|
||||
// Show error message
|
||||
if (this.scene.events) {
|
||||
this.scene.events.emit('show-floating-text', {
|
||||
x: gridX * 48,
|
||||
y: gridY * 48,
|
||||
text: '🚫 Unlock farm first!',
|
||||
color: '#ff0000'
|
||||
});
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check if already tilled
|
||||
const key = `${gridX},${gridY}`;
|
||||
if (this.isTilled(gridX, gridY)) {
|
||||
|
||||
Reference in New Issue
Block a user