Fix digging

This commit is contained in:
Bram Verhulst
2024-04-20 20:20:54 +02:00
parent ebda39f690
commit 5477b8a7f2
11 changed files with 258 additions and 126 deletions

View File

@@ -59,6 +59,9 @@ public:
void ProcessImGui();
private:
void Dig(Collision::CollisionDirection dir, WorldLevel& level);
bool CanDig(Collision::CollisionDirection dir, WorldLevel& level);
Vector2f m_Position;
Vector2f m_Size;
@@ -73,15 +76,18 @@ private:
bool m_BobUp{ true };
Vector2f m_DigDestination{};
bool m_Digging{ false };
Vector2f m_DigStart{};
float m_DigProgress{};
bool m_HasDeletedTile{ false };
WorldTile* m_DigTile{ nullptr };
const float m_DigTime{ 1.0f };
const float m_DigTime{ 0.5f };
bool m_Grounded { false };
bool m_DidJustDigRight { false };
bool m_DidJustDigLeft { false };
Animation* m_currentAnimation{ nullptr };
Animation* m_walkAnimation;
Animation* m_turnAnimation;