Add player controls (X/C keys) + generate 38 new assets (195 total)
- Implemented X key for chopping action (handleChoppingAction) - Implemented C key for mining action (handleMiningAction) - Added silver arrows to inventory (10x) - Generated 38 new PNG assets: * Trees: pine, oak, maple * Crops: carrot, tomato, pumpkin, pepper, cabbage * Buildings: silo, composter * Environment: rock, bush, daisy, log, pond, stump, berries * Tools: iron sword, scythe, fishing rod, shovel, boots, stone, wood * Food/Items: cheese, milk, egg, fertilizer, hay bale * Lighting: torch, lantern * Animals: hedgehog, horse, sheep, pig, bat, owl
|
Before Width: | Height: | Size: 675 KiB After Width: | Height: | Size: 649 KiB |
BIN
assets/images/buildings/chest_storage.png
Normal file
|
After Width: | Height: | Size: 642 KiB |
BIN
assets/images/buildings/composter.png
Normal file
|
After Width: | Height: | Size: 637 KiB |
BIN
assets/images/buildings/fence_wood.png
Normal file
|
After Width: | Height: | Size: 530 KiB |
BIN
assets/images/buildings/gate_wood.png
Normal file
|
After Width: | Height: | Size: 547 KiB |
BIN
assets/images/buildings/silo.png
Normal file
|
After Width: | Height: | Size: 755 KiB |
BIN
assets/images/buildings/well_water.png
Normal file
|
After Width: | Height: | Size: 534 KiB |
BIN
assets/images/buildings/windmill.png
Normal file
|
After Width: | Height: | Size: 653 KiB |
BIN
assets/images/crops/cabbage.png
Normal file
|
After Width: | Height: | Size: 585 KiB |
BIN
assets/images/crops/carrot.png
Normal file
|
After Width: | Height: | Size: 613 KiB |
BIN
assets/images/crops/pepper.png
Normal file
|
After Width: | Height: | Size: 598 KiB |
BIN
assets/images/crops/pumpkin.png
Normal file
|
After Width: | Height: | Size: 794 KiB |
BIN
assets/images/crops/tomato.png
Normal file
|
After Width: | Height: | Size: 613 KiB |
BIN
assets/images/environment/bush_green.png
Normal file
|
After Width: | Height: | Size: 511 KiB |
BIN
assets/images/environment/flower_daisy.png
Normal file
|
After Width: | Height: | Size: 543 KiB |
BIN
assets/images/environment/log_wood.png
Normal file
|
After Width: | Height: | Size: 599 KiB |
BIN
assets/images/environment/pond_water.png
Normal file
|
After Width: | Height: | Size: 711 KiB |
BIN
assets/images/environment/rock_large.png
Normal file
|
After Width: | Height: | Size: 530 KiB |
BIN
assets/images/environment/tree_maple.png
Normal file
|
After Width: | Height: | Size: 629 KiB |
|
Before Width: | Height: | Size: 564 KiB After Width: | Height: | Size: 633 KiB |
BIN
assets/images/environment/tree_pine.png
Normal file
|
After Width: | Height: | Size: 485 KiB |
BIN
assets/images/environment/tree_stump.png
Normal file
|
After Width: | Height: | Size: 606 KiB |
BIN
assets/images/items/berry_wild.png
Normal file
|
After Width: | Height: | Size: 574 KiB |
BIN
assets/images/items/boots_leather.png
Normal file
|
After Width: | Height: | Size: 576 KiB |
BIN
assets/images/items/cheese.png
Normal file
|
After Width: | Height: | Size: 498 KiB |
BIN
assets/images/items/egg.png
Normal file
|
After Width: | Height: | Size: 570 KiB |
BIN
assets/images/items/fertilizer.png
Normal file
|
After Width: | Height: | Size: 492 KiB |
BIN
assets/images/items/fishing_rod.png
Normal file
|
After Width: | Height: | Size: 515 KiB |
BIN
assets/images/items/hay_bale.png
Normal file
|
After Width: | Height: | Size: 579 KiB |
BIN
assets/images/items/lantern.png
Normal file
|
After Width: | Height: | Size: 708 KiB |
BIN
assets/images/items/milk.png
Normal file
|
After Width: | Height: | Size: 558 KiB |
BIN
assets/images/items/scythe_iron.png
Normal file
|
After Width: | Height: | Size: 612 KiB |
BIN
assets/images/items/shovel.png
Normal file
|
After Width: | Height: | Size: 565 KiB |
BIN
assets/images/items/stone.png
Normal file
|
After Width: | Height: | Size: 500 KiB |
BIN
assets/images/items/sword_iron.png
Normal file
|
After Width: | Height: | Size: 639 KiB |
BIN
assets/images/items/torch.png
Normal file
|
After Width: | Height: | Size: 594 KiB |
BIN
assets/images/items/wood.png
Normal file
|
After Width: | Height: | Size: 548 KiB |
BIN
assets/images/zivali/bat_nocturnal.png
Normal file
|
After Width: | Height: | Size: 684 KiB |
BIN
assets/images/zivali/hedgehog_wild.png
Normal file
|
After Width: | Height: | Size: 534 KiB |
BIN
assets/images/zivali/horse_normal.png
Normal file
|
After Width: | Height: | Size: 627 KiB |
BIN
assets/images/zivali/owl_nocturnal.png
Normal file
|
After Width: | Height: | Size: 531 KiB |
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||