Skip to content

Commit

Permalink
track the number of shots fired by player(s)
Browse files Browse the repository at this point in the history
  • Loading branch information
RiverHillbug committed Jun 6, 2024
1 parent 4b87cd4 commit 71a04bc
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions Galaga/BulletsManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ void BulletsManager::Shoot(const int ownerIndex, const glm::vec2& position)

m_ShootTimer[ownerIndex] = SHOOT_INTERVAL;
++m_ActivePlayerBulletCounts[ownerIndex];
++m_ShotsFired[ownerIndex];
}

void BulletsManager::Initialize()
Expand Down
1 change: 1 addition & 0 deletions Galaga/BulletsManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class BulletsManager : public Fluffy::Singleton<BulletsManager>, Fluffy::IEventL

float m_ShootTimer[2]{ 0.0f };
int m_ActivePlayerBulletCounts[2]{ 0 };
int m_ShotsFired[2]{ 0 };

void PoolBullet(Bullet* pBullet);
};
1 change: 0 additions & 1 deletion Galaga/ShootCommand.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,5 @@ class ShootCommand final : public Fluffy::Command

private:
const int m_PlayerIndex;
int m_ShotsFired{ 0 };
};

0 comments on commit 71a04bc

Please sign in to comment.