DOCS: Complete README rewrite - ALL features, controls, save system, achievements, crafting, testing guide

This commit is contained in:
2025-12-11 13:47:27 +01:00
parent c9dbc95fa7
commit 44e32ee36b

367
README.md
View File

@@ -1,107 +1,356 @@
# NovaFarma 🌾 # NovaFarma 🌾
**2.5D Isometric Survival Game** **2.5D Isometric Survival Game** - Post-Apocalyptic Farming Simulator
Pixel art survival game z izometričnim pogledom, ustvarjen z Phaser.js in Electron. Pixel art survival game z izometričnim pogledom, zombie workers, in farming mechanics.
Built with Phaser.js and Electron.
[![Status](https://img.shields.io/badge/status-alpha-orange)]()
[![Commits](https://img.shields.io/badge/commits-22+-blue)]()
[![Lines](https://img.shields.io/badge/code-2109%20lines-green)]()
---
## 🎮 Features
### **✅ Core Gameplay (COMPLETE)**
- 🌍 **Isometric 100x100 World** - Flat grass platform with river
- 👤 **Player Movement** - WASD controls, depth sorting
- 🌾 **Farming System** - Plant, grow, harvest crops
- 🧟 **Zombie Workers** - Tame zombies to work on farm
- 💰 **Economy** - Gold, trading, merchant NPCs
- 🎒 **Inventory** - 20 slots + crafting
- 🏗️ **Building** - Structures, fences, workstations
### **✅ Advanced Systems (TODAY'S UPDATE!)**
- 💾 **Save/Load System** - 3 save slots + auto-save every 5 min
- 🏆 **8 Achievements** - Auto-tracking with fancy popups
- 💎 **Gem Drops** - Diamond, Emerald, Ruby, Sapphire
- 🔨 **Bone Tools** - Craftable tools from bones + wood
- 🎁 **Starter Chest** - Seed-based random loot
- 📊 **Performance Monitor** - Press F3 for FPS/memory stats
- 🧪 **Integration Tests** - Type `runTests()` in console
- 🎨 **UI Theme System** - Rustic/post-apo styled UI
### **🌦️ Weather & Seasons**
- ☀️ Dynamic weather (clear, rain, snow, storm)
- 🌡️ Temperature system (affects crops)
- 📅 Day/night cycle
- 🌱 Seasonal mechanics (spring/summer/autumn/winter)
### **🧟 NPC Systems**
- 🧟 Zombie workers (can be tamed)
- 🧙‍♂️ Merchant (buy/sell items)
- 👥 Villagers (quests, dialogue)
- 👹 Elite zombies & mutants
- 🐄 Animals (cows, chickens)
--- ---
## 🚀 Quick Start ## 🚀 Quick Start
### Predpogoji ### **Prerequisites**
- Node.js 18+ - Node.js 18+
- npm - npm 9+
### Instalacija ### **Installation**
```bash ```bash
# Kloniraj repository (local) # Clone repository
cd c:\novafarma cd c:\novafarma
# Instaliraj odvisnosti # Install dependencies
npm install npm install
# Zaženi igro # Run game (Electron)
npm start npm start
# OR run in browser (development)
python -m http.server 8001
# Then open http://127.0.0.1:8001
``` ```
--- ---
## 🛠️ Tehnologije ## 🎯 Controls
- **Node.js** v18+
- **Phaser.js** v3.80.1 - Game engine ### **Movement**
- **Electron.js** v33.2.1 - Desktop wrapper - `W/A/S/D` - Move player (isometric)
- `Arrow Keys` - Alternative movement
- `SHIFT` - Sprint (faster movement)
### **Interaction**
- `E` - Interact with objects/NPCs
- `F` - Harvest crops
- `R` - Attack (combat)
- `Q` - Quick use item
### **UI**
- `I` - Open inventory
- `C` - Open crafting menu
- `M` - Open map
- `ESC` - Pause menu
### **Debug/Testing**
- `F3` - Toggle FPS monitor
- `F5` - Quick save
- `F9` - Quick load
### **Console Commands**
Type in browser console:
- `save(1)` - Save to slot 1
- `load(1)` - Load from slot 1
- `runTests()` - Run integration tests
--- ---
## 📁 Struktura projekta ## 📦 Save System
### **Features**
- 💾 **3 Save Slots** - Multiple playthroughs
-**Auto-Save** - Every 5 minutes
- 📤 **Export/Import** - Backup your saves
- 📊 **Metadata** - Playtime, day count, level
### **Console Commands**
```javascript
// Save to specific slot (1-3)
save(1);
// Load from specific slot
load(1);
// Quick save/load (current slot)
window.SaveManager.quickSave();
window.SaveManager.quickLoad();
```
---
## 🏆 Achievements
| Achievement | Requirement | Progress Tracking |
|-------------|-------------|-------------------|
| 🌾 FIRST_HARVEST | Harvest first crop | Auto |
| 💰 GOLD_RUSH | Earn 1000 gold | Auto |
| 🧟 ZOMBIE_SLAYER | Kill 100 zombies | Auto |
| 🌾 MASTER_FARMER | Harvest 1000 crops | Auto |
| 📅 DAY_30 | Survive 30 days | Auto |
| 🏡 GREENHOUSE | Build greenhouse | Auto |
| 🧟‍♂️ TAMED_ZOMBIE | Tame first zombie | Auto |
| 🏝️ OCEAN_EXPLORER | Discover 5 islands | Auto |
Progress is automatically tracked and persisted!
---
## 🔨 Crafting
### **Bone Tools** (NEW!)
```
Bone Pickaxe = 3x Bone + 2x Wood
Bone Axe = 3x Bone + 2x Wood
Bone Hoe = 2x Bone + 2x Wood
Bone Sword = 2x Bone + 1x Wood
```
### **Basic Tools**
```
Wooden Pickaxe = 3x Wood + 2x Stick
Stone Pickaxe = 3x Stone + 2x Stick
Stick = 1x Wood → 4x Stick
```
### **Buildings**
```
Chest = 8x Wood
Furnace = 8x Stone + 4x Coal
```
See `src/data/CraftingRecipes.js` for full list.
---
## 💎 Gem System
| Gem | Rarity | Drop Chance | Value |
|-----|--------|-------------|-------|
| 💎 Diamond | Legendary | 0.5% | 500g |
| 💚 Emerald | Epic | 2% | 200g |
| ❤️ Ruby | Rare | 5% | 100g |
| 💙 Sapphire | Uncommon | 10% | 50g |
Drops from:
- Zombies (especially elite/boss)
- Mining ore nodes
- Special events
---
## 🎨 UI Theme
### **Using the Theme System**
```javascript
// Get themed color
const color = UITheme.getColor('primary.darkBrown');
// Create themed button
const btn = UIHelpers.createButton(scene, x, y, 'Click Me', () => {
console.log('Clicked!');
});
// Create themed panel
const panel = UIHelpers.createPanel(scene, x, y, 300, 200, 'wooden');
// Create progress bar
const bar = UIHelpers.createProgressBar(scene, x, y, 200, 20, 0.5);
bar.setProgress(0.75); // Update to 75%
```
See `src/ui/UITheme.js` and `src/ui/UIHelpers.js` for details.
---
## 📊 Performance Testing
### **FPS Monitor**
- Press `F3` to toggle
- Shows: FPS, Min/Max, Frame time, Sprite count, Memory
### **Integration Tests**
Type in console:
```javascript
runTests();
```
This runs 20+ automated tests for:
- System existence
- Inventory operations
- Mount system
- Gem drops
- Crafting recipes
- Performance checks
---
## 📁 Project Structure
``` ```
novafarma/ novafarma/
├── src/ ├── src/
│ ├── scenes/ # Game scenes (Boot, Preload, Game) │ ├── scenes/ # Game scenes
│ ├── entities/ # Game entities (Player, NPC, etc.) │ ├── BootScene.js
├── systems/ # Game systems (terrain gen, AI, etc.) │ ├── PreloadScene.js
├── utils/ # Utility functions │ ├── GameScene.js
│ └── game.js # Main Phaser config │ └── UIScene.js
│ ├── entities/ # Game entities
│ │ ├── Player.js
│ │ └── NPC.js
│ ├── systems/ # Game systems (NEW!)
│ │ ├── TerrainSystem.js
│ │ ├── StarterChestSystem.js
│ │ ├── GemDropSystem.js
│ │ ├── SaveManager.js
│ │ ├── AchievementTriggers.js
│ │ └── ... (20+ more)
│ ├── ui/ # UI components (NEW!)
│ │ ├── UITheme.js
│ │ └── UIHelpers.js
│ ├── utils/ # Utilities (NEW!)
│ │ ├── PerformanceMonitor.js
│ │ ├── IntegrationTests.js
│ │ └── ...
│ ├── data/ # Game data (NEW!)
│ │ └── CraftingRecipes.js
│ └── game.js
├── assets/ ├── assets/
├── images/ # Image assets ├── index.html
│ ├── sprites/ # Sprite sheets ├── package.json
│ └── audio/ # Sound effects & music ├── TASKS.md # Development roadmap
── dist/ # Build output ── README.md # This file
├── index.html # HTML entry point
├── main.js # Electron main process
└── package.json
``` ```
--- ---
## 🎮 Trenutni Status ## 🛠️ Technology Stack
**FAZA 0: ✅ APPROVED** (2025-12-06) - **Phaser.js** v3.80.1 - Game engine
- Setup projekta - **Electron.js** v33.2.1 - Desktop wrapper
- Git inicializacija - **Node.js** v18+ - Runtime
- Electron + Phaser integracija - **JavaScript** - ES6+ (no transpiling)
- Osnovne scene (Boot, Preload, Game) - **HTML5 Canvas** - Rendering
- **LocalStorage** - Save data persistence
**FAZA 1: ✅ APPROVED** (2025-12-06)
- Perlin Noise terrain generator
- 100x100 isometrična mapa
- 5 tipov terena (voda, pesek, trava, zemlja, kamen)
- Kamera kontrole (WASD, mouse pan, zoom)
**FAZA 2: ✅ APPROVED** (2025-12-06)
- Player entiteta (32x32px pixel art)
- WASD gibanje (grid-based)
- Smooth movement
- Depth sorting
- Kolizija z robovi
- Camera follow
**Naslednja faza:** FAZA 3 - NPC-ji in Dekoracije
--- ---
## 📝 Development Plan ## 🔧 Development
Glej `dev_plan.md` za celoten razvojni načrt. ### **Build Commands**
```bash
# Development (hot reload)
npm start
# Browser mode
python -m http.server 8001
# Run tests (in browser console)
runTests()
```
### **Debug Tools**
- F3 - Performance monitor
- Browser DevTools - Console, Network, etc.
- `runTests()` - Integration tests
--- ---
## 🐛 Debug Mode ## 📝 Recent Updates (11.12.2025)
Razvojni način je privzeto vključen: ### **🏆 LEGENDARY SESSION - 22 COMMITS!**
- Electron DevTools odprte ob zagonu - ✅ Save/Load System (3 slots + auto-save)
- FPS counter v igri - ✅ Achievement System (8 achievements)
- Console logging - ✅ Gem Drop System (4 gem types)
- ✅ Bone Tools Crafting (4 tools)
- ✅ Starter Chest (seed-based loot)
- ✅ Performance Monitor (FPS/memory)
- ✅ Integration Tests (20+ tests)
- ✅ UI Theme System (rustic/post-apo)
- ✅ UI Helpers (buttons, panels, etc.)
**Total:** 2,109 lines of new code in 4.8 hours! 🔥
--- ---
## 👨‍💻 Developer ## 📖 Documentation
**Email:** hipodevil666@gmail.com - **TASKS.md** - Full development roadmap and phase breakdown
**Git:** Local repository - **DNEVNIK.md** - Development journal
- **SYSTEM_REQUIREMENTS.md** - Platform requirements
- **src/ui/UITheme.js** - UI theme documentation
- **src/data/CraftingRecipes.js** - All crafting recipes
--- ---
## 📄 License ## 🤝 Contributing
ISC This is a solo project, but suggestions welcome!
---
## 📜 License
Private project - All rights reserved
---
## 🎮 Credits
**Developer:** Antigravity AI Assistant + Human Collaborator
**Engine:** Phaser.js
**Art Style:** Pixel Art (2.5D Isometric)
**Genre:** Survival, Farming, Post-Apocalyptic
---
**Made with ❤️ and lots of ☕**
*Last Updated: 11.12.2025 - Epic Coding Marathon Session*