Files
novafarma/SEZNAM_STAVB_IN_DEKORACIJ.md
2025-12-12 02:41:00 +01:00

322 lines
8.4 KiB
Markdown

# 🏗️ POPOLN SEZNAM STAVB IN DEKORACIJ - NovaFarma
## 📋 **PREGLED**
V igri NovaFarma imaš na voljo **2 načina** postavljanja objektov:
1. **Build Mode** (tipka `B`) - Interaktivno postavljanje
2. **Programsko** - Dodaš kodo v `GameScene.js`
---
## 🏗️ **STAVBE (Build Mode - Tipka B)**
### **Razpoložljive Stavbe:**
| Tipka | Ime | ID | Cena | Kolizija | Opis |
|-------|-----|-----|------|----------|------|
| `1` | Fence Post | `fence_post` | 1 les | Ne | Ograjen steber |
| `2` | Fence Horizontal | `fence_horizontal` | 2 lesa | Ne | Vodoravna ograja → |
| `3` | Fence Vertical | `fence_vertical` | 2 lesa | Ne | Navpična ograja ↓ |
| `4` | Fence Corner | `fence_corner` | 2 lesa | Ne | Vogalna ograja ⌞ |
| `5` | Barn | `barn` | 40 lesa + 20 kamna | Da | Hlev za živali |
### **Dodatne Stavbe (Samo Programsko):**
| ID | Ime | Cena | Kolizija | Opis |
|----|-----|------|----------|------|
| `fence` | Old Fence | 2 lesa | Ne | Stara izometrična ograja |
| `grave` | Grave | 10 kamna | Ne | Grob za zombije |
| `farmhouse` | Farmhouse | 50 lesa + 30 kamna + 100 zlata | Da | Hiša za igralca |
| `blacksmith` | Blacksmith | 30 lesa + 40 kamna + 80 zlata | Da | Kovačnica |
---
## 🌳 **DEKORACIJE (Programsko - TerrainSystem)**
### **Drevesa:**
| ID | Ime | Opis |
|----|-----|------|
| `tree_green_final` | Zeleno Drevo | Navadno zeleno drevo |
| `tree_blue_final` | Modro Drevo | Navadno modro drevo |
| `tree_sapling` | Sadika | Mlado drevo |
| `tree_apple` | Jablana | Sadno drevo (jabolka) |
| `tree_orange` | Oranževec | Sadno drevo (oranže) |
| `tree_cherry` | Češnja | Sadno drevo (češnje) |
| `tree_dead_new` | Mrtvo Drevo | Suho drevo |
### **Skale:**
| ID | Ime | Opis |
|----|-----|------|
| `rock_asset` | Kamen | Navadna skala |
| `rock_1` | Skala 1 | Manjša skala |
| `rock_2` | Skala 2 | Večja skala |
### **Cvetje in Rastline:**
| ID | Ime | Opis |
|----|-----|------|
| `flowers_new` | Cvetje | Dekorativno cvetje |
| `bush` | Grm | Dekorativen grm |
### **Strukture:**
| ID | Ime | Opis |
|----|-----|------|
| `fence` | Ograja | Lesena ograja |
| `gravestone` | Nagrobnik | Nagrobni kamen |
| `chest` | Skrinja | Skrinja za predmete |
| `spawner` | Spawner | Zombie spawner |
| `ruin` | Ruševina | Zapuščena zgradba |
| `arena` | Arena | Bojno območje |
| `furnace` | Talilna Peč | Tali rudo v kovine |
| `mint` | Kovnica | Kuje kovance |
### **Signposti (Navigacija):**
| ID | Ime | Opis |
|----|-----|------|
| `signpost_city` | Smer Mesto | Puščica → |
| `signpost_farm` | Smer Farma | Puščica ← |
| `signpost_both` | Obe Smeri | Puščica ⇅ |
---
## 💻 **KAKO UPORABITI (Programsko)**
### **1. Postavitev Stavb (BuildSystem)**
```javascript
// V GameScene.js, po vrstici: this.buildSystem = new BuildSystem(this);
// Ena ograja
this.buildSystem.placeSingleFence(50, 50, 'fence_post', false);
// Linija ograj
this.buildSystem.placeFenceLine(40, 40, 50, 40, 'fence_horizontal', false);
// Pravokotnik ograj
this.buildSystem.placeFenceRectangle(30, 30, 20, 15, 'fence_post', false);
// Hlev
this.buildSystem.placeSingleFence(60, 60, 'barn', false);
// Farmhouse
this.buildSystem.placeSingleFence(70, 70, 'farmhouse', false);
```
### **2. Postavitev Dekoracij (TerrainSystem)**
```javascript
// V GameScene.js, po vrstici: this.terrainSystem.generate();
// Drevesa
this.terrainSystem.addDecoration(45, 45, 'tree_green_final');
this.terrainSystem.addDecoration(46, 45, 'tree_apple');
this.terrainSystem.addDecoration(47, 45, 'tree_dead_new');
// Skale
this.terrainSystem.addDecoration(50, 55, 'rock_asset');
this.terrainSystem.addDecoration(51, 55, 'rock_1');
// Cvetje
this.terrainSystem.addDecoration(40, 50, 'flowers_new');
this.terrainSystem.addDecoration(41, 50, 'bush');
// Strukture
this.terrainSystem.placeStructure(60, 50, 'chest');
this.terrainSystem.placeStructure(65, 50, 'furnace');
this.terrainSystem.placeStructure(70, 50, 'mint');
```
### **3. Postavitev Kompleksnih Struktur**
```javascript
// Ruševina (6x6 območje)
this.terrainSystem.placeStructure(55, 55, 'ruin');
// Arena (12x12 območje)
this.terrainSystem.placeStructure(75, 55, 'arena');
// Zombie Spawner
this.terrainSystem.placeStructure(80, 80, 'spawner');
```
---
## 🎨 **PRIMERI UPORABE**
### **Primer 1: Ustvari Sadovnjak (10x10)**
```javascript
// V GameScene.js, po inicializaciji terrainSystem
for (let x = 20; x < 30; x++) {
for (let y = 20; y < 30; y++) {
if ((x + y) % 3 === 0) { // Vsako 3. mesto
const trees = ['tree_apple', 'tree_orange', 'tree_cherry'];
const randomTree = trees[Math.floor(Math.random() * trees.length)];
this.terrainSystem.addDecoration(x, y, randomTree);
}
}
}
console.log('🍎 Sadovnjak ustvarjen!');
```
### **Primer 2: Ustvari Kamnolom**
```javascript
// Območje polno skal
for (let x = 60; x < 70; x++) {
for (let y = 60; y < 70; y++) {
if (Math.random() > 0.5) {
this.terrainSystem.addDecoration(x, y, 'rock_asset');
}
}
}
console.log('⛏️ Kamnolom ustvarjen!');
```
### **Primer 3: Ustvari Vas (5 hiš)**
```javascript
// Postavi 5 hiš v vrsti
for (let i = 0; i < 5; i++) {
this.buildSystem.placeSingleFence(30 + (i * 5), 70, 'farmhouse', false);
}
// Dodaj ograje okoli vasi
this.buildSystem.placeFenceRectangle(28, 68, 27, 6, 'fence_horizontal', false);
console.log('🏘️ Vas ustvarjena!');
```
### **Primer 4: Ustvari Pokopališče**
```javascript
// 5x5 pokopališče
for (let x = 40; x < 45; x++) {
for (let y = 40; y < 45; y++) {
if ((x + y) % 2 === 0) {
this.terrainSystem.addDecoration(x, y, 'gravestone');
}
}
}
// Ograja okoli pokopališča
this.buildSystem.placeFenceRectangle(39, 39, 7, 7, 'fence_post', false);
console.log('🪦 Pokopališče ustvarjeno!');
```
### **Primer 5: Ustvari Gozd**
```javascript
// Naključen gozd 20x20
for (let x = 10; x < 30; x++) {
for (let y = 10; y < 30; y++) {
if (Math.random() > 0.7) { // 30% verjetnost
const trees = ['tree_green_final', 'tree_blue_final', 'tree_dead_new'];
const randomTree = trees[Math.floor(Math.random() * trees.length)];
this.terrainSystem.addDecoration(x, y, randomTree);
}
}
}
console.log('🌲 Gozd ustvarjen!');
```
---
## 📍 **KJE DODATI KODO**
### **Za Stavbe (BuildSystem):**
Datoteka: `c:\novafarma\src\scenes\GameScene.js`
Lokacija: **Vrstica 68** (takoj po `this.buildSystem = new BuildSystem(this);`)
### **Za Dekoracije (TerrainSystem):**
Datoteka: `c:\novafarma\src\scenes\GameScene.js`
Lokacija: **Vrstica 80** (takoj po `this.initializeFarmWorld();`)
---
## 🎮 **BUILD MODE (Interaktivno)**
### **Kako Uporabiti:**
1. **Zaženi igro** (`npm start`)
2. **Pritisni `B`** → Vklopi Build Mode
3. **Izberi stavbo:**
- `1` = Fence Post
- `2` = Fence Horizontal
- `3` = Fence Vertical
- `4` = Fence Corner
- `5` = Barn
4. **Premikaj miško** → Vidiš predogled
5. **Klikni** → Postavi stavbo
6. **Pritisni `B`** → Izklopi Build Mode
### **Barve Predogleda:**
- 🟢 **Zelena** = Lahko postaviš (dovolj virov, prosto mesto)
- 🔴 **Rdeča** = Ne moreš postaviti (premalo virov ali zasedeno)
---
## 💰 **CENE STAVB**
| Stavba | Les | Kamen | Zlato |
|--------|-----|-------|-------|
| Fence Post | 1 | - | - |
| Fence Horizontal | 2 | - | - |
| Fence Vertical | 2 | - | - |
| Fence Corner | 2 | - | - |
| Old Fence | 2 | - | - |
| Barn | 40 | 20 | - |
| Grave | - | 10 | - |
| Farmhouse | 50 | 30 | 100 |
| Blacksmith | 30 | 40 | 80 |
**Opomba:** Če uporabljaš programsko postavitev z `consumeResources = false`, se viri **NE** porabijo!
---
## 🔧 **KONZOLNI UKAZI (Debug)**
```javascript
// Dodaj vire
this.scene.scenes[0].inventorySystem.addItem('wood', 1000);
this.scene.scenes[0].inventorySystem.addItem('stone', 1000);
this.scene.scenes[0].inventorySystem.gold = 10000;
// Postavi peč pri igralcu
placeFurnace();
// Postavi kovnico pri igralcu
placeMint();
```
---
## 📝 **OPOMBE**
### **Razlika med BuildSystem in TerrainSystem:**
- **BuildSystem** → Stavbe (ograje, hiše, hlevi)
- **TerrainSystem** → Dekoracije (drevesa, skale, cvetje, strukture)
### **Kolizije:**
Nekatere stavbe imajo kolizijo (igralec ne more skozi):
- ✅ Barn
- ✅ Farmhouse
- ✅ Blacksmith
Ograje in dekoracije **NIMAJO** kolizije (igralec lahko gre skozi).
---
**Pripravil:** Antigravity AI
**Datum:** 12.12.2025
**Verzija:** 1.0
**Srečno pri gradnji!** 🏗️🌾