Add wall hit sound and animation

This commit is contained in:
2025-03-10 11:58:45 -07:00
parent d8c5bc8f78
commit 23049b3231
11 changed files with 189 additions and 47 deletions

View File

@@ -19,6 +19,10 @@ public interface IGameRepo : IDisposable
event Action<InventoryItem>? RemoveItemFromInventoryEvent;
event Action? PlayerAttack;
event Action? PlayerAttackedWall;
void Pause();
void Resume();
@@ -35,6 +39,10 @@ public interface IGameRepo : IDisposable
public void RemoveItemFromInventory(InventoryItem item);
public void OnPlayerAttack();
public void OnPlayerAttackedWall();
public void CloseInventory();
public void GameEnded();
@@ -51,6 +59,8 @@ public class GameRepo : IGameRepo
public event Action<int>? DoubleExpTimeStart;
public event Action? DoubleExpTimeEnd;
public event Action<InventoryItem>? RemoveItemFromInventoryEvent;
public event Action? PlayerAttack;
public event Action? PlayerAttackedWall;
public IAutoProp<bool> IsPaused => _isPaused;
private readonly AutoProp<bool> _isPaused;
@@ -105,6 +115,16 @@ public class GameRepo : IGameRepo
RemoveItemFromInventoryEvent?.Invoke(item);
}
public void OnPlayerAttack()
{
PlayerAttack?.Invoke();
}
public void OnPlayerAttackedWall()
{
PlayerAttackedWall?.Invoke();
}
public void CloseInventory()
{
CloseInventoryEvent?.Invoke();