Skip to content

Commit 71a04bc

Browse files
committed
track the number of shots fired by player(s)
1 parent 4b87cd4 commit 71a04bc

File tree

3 files changed

+2
-1
lines changed

3 files changed

+2
-1
lines changed

Galaga/BulletsManager.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ void BulletsManager::Shoot(const int ownerIndex, const glm::vec2& position)
3636

3737
m_ShootTimer[ownerIndex] = SHOOT_INTERVAL;
3838
++m_ActivePlayerBulletCounts[ownerIndex];
39+
++m_ShotsFired[ownerIndex];
3940
}
4041

4142
void BulletsManager::Initialize()

Galaga/BulletsManager.h

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ class BulletsManager : public Fluffy::Singleton<BulletsManager>, Fluffy::IEventL
3737

3838
float m_ShootTimer[2]{ 0.0f };
3939
int m_ActivePlayerBulletCounts[2]{ 0 };
40+
int m_ShotsFired[2]{ 0 };
4041

4142
void PoolBullet(Bullet* pBullet);
4243
};

Galaga/ShootCommand.h

-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,5 @@ class ShootCommand final : public Fluffy::Command
2222

2323
private:
2424
const int m_PlayerIndex;
25-
int m_ShotsFired{ 0 };
2625
};
2726

0 commit comments

Comments
 (0)