diff --git a/source/code/main.cpp b/source/code/main.cpp index e17a5c4..5b5a67e 100644 --- a/source/code/main.cpp +++ b/source/code/main.cpp @@ -312,6 +312,7 @@ private: int color = 0; unsigned long int lastTime = 0; public: + bool inUse = false; ABall() { } @@ -365,19 +366,15 @@ static const int maxNumberOfBalls = 6*12*2*2; class BallManager { public: ABall ballArray[maxNumberOfBalls]; - bool ballUsed[maxNumberOfBalls]; BallManager() { - for (int i=0; iglobalData.ysize+100 || ballArray[i].getX()>globalData.xsize || ballArray[i].getX()<-ballSize) { - ballUsed[i] = false; + ballArray[i].inUse = false; } } } @@ -420,6 +417,7 @@ private: //How many images there are in the animation unsigned long int placeTime = 0; //Then the explosion occored public: + bool inUse = false; AnExplosion() { } @@ -454,17 +452,13 @@ public: class ExplosionManager { public: AnExplosion explosionArray[maxNumberOfBalls]; - bool explosionUsed[maxNumberOfBalls]; ExplosionManager() { - for (int i=0; i