diff --git a/assets/images/buildings/barn.png b/assets/images/buildings/barn.png index b20446eca..6443a5e67 100644 Binary files a/assets/images/buildings/barn.png and b/assets/images/buildings/barn.png differ diff --git a/assets/images/buildings/chest_storage.png b/assets/images/buildings/chest_storage.png new file mode 100644 index 000000000..be049f5d9 Binary files /dev/null and b/assets/images/buildings/chest_storage.png differ diff --git a/assets/images/buildings/composter.png b/assets/images/buildings/composter.png new file mode 100644 index 000000000..52c3a6d82 Binary files /dev/null and b/assets/images/buildings/composter.png differ diff --git a/assets/images/buildings/fence_wood.png b/assets/images/buildings/fence_wood.png new file mode 100644 index 000000000..605385e8c Binary files /dev/null and b/assets/images/buildings/fence_wood.png differ diff --git a/assets/images/buildings/gate_wood.png b/assets/images/buildings/gate_wood.png new file mode 100644 index 000000000..a5247468d Binary files /dev/null and b/assets/images/buildings/gate_wood.png differ diff --git a/assets/images/buildings/silo.png b/assets/images/buildings/silo.png new file mode 100644 index 000000000..82760ae5f Binary files /dev/null and b/assets/images/buildings/silo.png differ diff --git a/assets/images/buildings/well_water.png b/assets/images/buildings/well_water.png new file mode 100644 index 000000000..75df727f5 Binary files /dev/null and b/assets/images/buildings/well_water.png differ diff --git a/assets/images/buildings/windmill.png b/assets/images/buildings/windmill.png new file mode 100644 index 000000000..1d549d1fc Binary files /dev/null and b/assets/images/buildings/windmill.png differ diff --git a/assets/images/crops/cabbage.png b/assets/images/crops/cabbage.png new file mode 100644 index 000000000..43511dc26 Binary files /dev/null and b/assets/images/crops/cabbage.png differ diff --git a/assets/images/crops/carrot.png b/assets/images/crops/carrot.png new file mode 100644 index 000000000..0d92b3536 Binary files /dev/null and b/assets/images/crops/carrot.png differ diff --git a/assets/images/crops/pepper.png b/assets/images/crops/pepper.png new file mode 100644 index 000000000..5db9331ad Binary files /dev/null and b/assets/images/crops/pepper.png differ diff --git a/assets/images/crops/pumpkin.png b/assets/images/crops/pumpkin.png new file mode 100644 index 000000000..d3bd0f5a5 Binary files /dev/null and b/assets/images/crops/pumpkin.png differ diff --git a/assets/images/crops/tomato.png b/assets/images/crops/tomato.png new file mode 100644 index 000000000..ae3977966 Binary files /dev/null and b/assets/images/crops/tomato.png differ diff --git a/assets/images/environment/bush_green.png b/assets/images/environment/bush_green.png new file mode 100644 index 000000000..dddf8617c Binary files /dev/null and b/assets/images/environment/bush_green.png differ diff --git a/assets/images/environment/flower_daisy.png b/assets/images/environment/flower_daisy.png new file mode 100644 index 000000000..3f2abad4a Binary files /dev/null and b/assets/images/environment/flower_daisy.png differ diff --git a/assets/images/environment/log_wood.png b/assets/images/environment/log_wood.png new file mode 100644 index 000000000..989bf0479 Binary files /dev/null and b/assets/images/environment/log_wood.png differ diff --git a/assets/images/environment/pond_water.png b/assets/images/environment/pond_water.png new file mode 100644 index 000000000..e1394f61e Binary files /dev/null and b/assets/images/environment/pond_water.png differ diff --git a/assets/images/environment/rock_large.png b/assets/images/environment/rock_large.png new file mode 100644 index 000000000..d4cd71c3d Binary files /dev/null and b/assets/images/environment/rock_large.png differ diff --git a/assets/images/environment/tree_maple.png b/assets/images/environment/tree_maple.png new file mode 100644 index 000000000..4f3611b96 Binary files /dev/null and b/assets/images/environment/tree_maple.png differ diff --git a/assets/images/environment/tree_oak.png b/assets/images/environment/tree_oak.png index 7c9548169..73d05e216 100644 Binary files a/assets/images/environment/tree_oak.png and b/assets/images/environment/tree_oak.png differ diff --git a/assets/images/environment/tree_pine.png b/assets/images/environment/tree_pine.png new file mode 100644 index 000000000..0cb91b13d Binary files /dev/null and b/assets/images/environment/tree_pine.png differ diff --git a/assets/images/environment/tree_stump.png b/assets/images/environment/tree_stump.png new file mode 100644 index 000000000..f3fddff34 Binary files /dev/null and b/assets/images/environment/tree_stump.png differ diff --git a/assets/images/items/berry_wild.png b/assets/images/items/berry_wild.png new file mode 100644 index 000000000..9b38212f1 Binary files /dev/null and b/assets/images/items/berry_wild.png differ diff --git a/assets/images/items/boots_leather.png b/assets/images/items/boots_leather.png new file mode 100644 index 000000000..a8b8823f8 Binary files /dev/null and b/assets/images/items/boots_leather.png differ diff --git a/assets/images/items/cheese.png b/assets/images/items/cheese.png new file mode 100644 index 000000000..2207fb2d1 Binary files /dev/null and b/assets/images/items/cheese.png differ diff --git a/assets/images/items/egg.png b/assets/images/items/egg.png new file mode 100644 index 000000000..02765d4dc Binary files /dev/null and b/assets/images/items/egg.png differ diff --git a/assets/images/items/fertilizer.png b/assets/images/items/fertilizer.png new file mode 100644 index 000000000..3ce7e05a8 Binary files /dev/null and b/assets/images/items/fertilizer.png differ diff --git a/assets/images/items/fishing_rod.png b/assets/images/items/fishing_rod.png new file mode 100644 index 000000000..2892a8ddc Binary files /dev/null and b/assets/images/items/fishing_rod.png differ diff --git a/assets/images/items/hay_bale.png b/assets/images/items/hay_bale.png new file mode 100644 index 000000000..132e368c5 Binary files /dev/null and b/assets/images/items/hay_bale.png differ diff --git a/assets/images/items/lantern.png b/assets/images/items/lantern.png new file mode 100644 index 000000000..a3729b6eb Binary files /dev/null and b/assets/images/items/lantern.png differ diff --git a/assets/images/items/milk.png b/assets/images/items/milk.png new file mode 100644 index 000000000..d606c6c7e Binary files /dev/null and b/assets/images/items/milk.png differ diff --git a/assets/images/items/scythe_iron.png b/assets/images/items/scythe_iron.png new file mode 100644 index 000000000..0714da15c Binary files /dev/null and b/assets/images/items/scythe_iron.png differ diff --git a/assets/images/items/shovel.png b/assets/images/items/shovel.png new file mode 100644 index 000000000..01c0ba216 Binary files /dev/null and b/assets/images/items/shovel.png differ diff --git a/assets/images/items/stone.png b/assets/images/items/stone.png new file mode 100644 index 000000000..71deb41d8 Binary files /dev/null and b/assets/images/items/stone.png differ diff --git a/assets/images/items/sword_iron.png b/assets/images/items/sword_iron.png new file mode 100644 index 000000000..19d27446f Binary files /dev/null and b/assets/images/items/sword_iron.png differ diff --git a/assets/images/items/torch.png b/assets/images/items/torch.png new file mode 100644 index 000000000..efbf4423f Binary files /dev/null and b/assets/images/items/torch.png differ diff --git a/assets/images/items/wood.png b/assets/images/items/wood.png new file mode 100644 index 000000000..1f8f5f920 Binary files /dev/null and b/assets/images/items/wood.png differ diff --git a/assets/images/zivali/bat_nocturnal.png b/assets/images/zivali/bat_nocturnal.png new file mode 100644 index 000000000..f1ea76056 Binary files /dev/null and b/assets/images/zivali/bat_nocturnal.png differ diff --git a/assets/images/zivali/hedgehog_wild.png b/assets/images/zivali/hedgehog_wild.png new file mode 100644 index 000000000..ad000f175 Binary files /dev/null and b/assets/images/zivali/hedgehog_wild.png differ diff --git a/assets/images/zivali/horse_normal.png b/assets/images/zivali/horse_normal.png new file mode 100644 index 000000000..b9689bf7d Binary files /dev/null and b/assets/images/zivali/horse_normal.png differ diff --git a/assets/images/zivali/owl_nocturnal.png b/assets/images/zivali/owl_nocturnal.png new file mode 100644 index 000000000..97b17c9ba Binary files /dev/null and b/assets/images/zivali/owl_nocturnal.png differ diff --git a/src/entities/Player.js b/src/entities/Player.js index f8d799204..815d6f306 100644 --- a/src/entities/Player.js +++ b/src/entities/Player.js @@ -165,7 +165,9 @@ class Player { // Actions space: Phaser.Input.Keyboard.KeyCodes.SPACE, shift: Phaser.Input.Keyboard.KeyCodes.SHIFT, - r: Phaser.Input.Keyboard.KeyCodes.R + r: Phaser.Input.Keyboard.KeyCodes.R, + x: Phaser.Input.Keyboard.KeyCodes.X, // 🪓 Chopping + c: Phaser.Input.Keyboard.KeyCodes.C // ⛏️ Mining }); // Gamepad Events @@ -312,6 +314,16 @@ class Player { if (this.keys.r && Phaser.Input.Keyboard.JustDown(this.keys.r)) { this.useSelectedItem(); } + + // 🪓 X KEY - Chopping Action + if (this.keys.x && Phaser.Input.Keyboard.JustDown(this.keys.x)) { + this.handleChoppingAction(); + } + + // ⛏️ C KEY - Mining Action + if (this.keys.c && Phaser.Input.Keyboard.JustDown(this.keys.c)) { + this.handleMiningAction(); + } } updateHeldItem() { @@ -826,4 +838,74 @@ class Player { }); } } + + handleChoppingAction() { + console.log('🪓 Chopping action!'); + + // Check if player has axe equipped + const uiScene = this.scene.scene.get('UIScene'); + const invSys = this.scene.inventorySystem; + + if (!uiScene || !invSys) return; + + const selectedIdx = uiScene.selectedSlot; + const slot = invSys.slots[selectedIdx]; + + if (!slot || slot.type !== 'axe') { + console.log('⚠️ No axe equipped!'); + return; + } + + // Calculate target tile in front of player + const targetX = this.gridX + Math.round(this.lastDir.x); + const targetY = this.gridY + Math.round(this.lastDir.y); + + // Trigger interaction system with chopping mode + if (this.scene.interactionSystem) { + this.scene.interactionSystem.handleInteraction(targetX, targetY, true); + } + + // Play chopping animation (swing tool) + this.swingTool(); + + // Play sound + if (this.scene.soundManager && this.scene.soundManager.playChop) { + this.scene.soundManager.playChop(); + } + } + + handleMiningAction() { + console.log('⛏️ Mining action!'); + + // Check if player has pickaxe equipped + const uiScene = this.scene.scene.get('UIScene'); + const invSys = this.scene.inventorySystem; + + if (!uiScene || !invSys) return; + + const selectedIdx = uiScene.selectedSlot; + const slot = invSys.slots[selectedIdx]; + + if (!slot || slot.type !== 'pickaxe') { + console.log('⚠️ No pickaxe equipped!'); + return; + } + + // Calculate target tile in front of player + const targetX = this.gridX + Math.round(this.lastDir.x); + const targetY = this.gridY + Math.round(this.lastDir.y); + + // Trigger interaction system with mining mode + if (this.scene.interactionSystem) { + this.scene.interactionSystem.handleInteraction(targetX, targetY, true); + } + + // Play mining animation (swing tool) + this.swingTool(); + + // Play sound + if (this.scene.soundManager && this.scene.soundManager.playMine) { + this.scene.soundManager.playMine(); + } + } } diff --git a/src/systems/InventorySystem.js b/src/systems/InventorySystem.js index 1adb2d102..2c8f2daf1 100644 --- a/src/systems/InventorySystem.js +++ b/src/systems/InventorySystem.js @@ -18,6 +18,7 @@ class InventorySystem { this.addItem('hoe', 1); this.addItem('watering_can', 1); // 💧 Zalivalka this.addItem('seeds', 5); // Zmanjšano število semen + this.addItem('arrow_silver', 10); // ➶ Silver arrows for werewolf hunting // Removed default wood/stone so player has to gather them this.gold = 0;