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
This commit is contained in:
2025-12-28 18:01:59 +01:00
parent 0671ec552a
commit 6573c6e48c
43 changed files with 84 additions and 1 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 675 KiB

After

Width:  |  Height:  |  Size: 649 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 642 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 637 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 530 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 547 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 755 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 534 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 653 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 585 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 613 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 598 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 794 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 613 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 511 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 543 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 599 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 711 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 530 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 629 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 564 KiB

After

Width:  |  Height:  |  Size: 633 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 485 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 606 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 574 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 576 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 498 KiB

BIN
assets/images/items/egg.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 570 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 492 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 515 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 579 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 708 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 558 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 612 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 565 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 500 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 639 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 594 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 548 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 684 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 534 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 627 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 531 KiB

View File

@@ -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();
}
}
}

View File

@@ -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;