Hey Everyone,
im trying to wrap my head around this for the last few hours but i cant find a solution.
im currently spawning Objects x times depending on my “EnemiesInWave” Variable
Once the “EnemieSpawned” is equal to my “EnemiesInWave” Variable it Pauses the Timer responsible for Spawning Enemies.
If then all Objects are destroyed and the Variable “DefeatedEnemies” equals “EnemiesInWave” it gives u a button to start the Next Wave
so far so good, but here is the issue sometimes these Objects go “missing” and if the u didnt destroy the correct amount of Objects the game wont continue, in order to fix this and still spawn the correct amount of Objects im trying to make a Enemie check that checks if there are still Enemies on the Screen/in Collission with a Sprite (CollisionenCheck).
if this is not the case and the variable “DefeatedEnemies” is not equal to “EnemiesInWave” it modifys another Variable “MissingEnemies” to the amount needed in order to continue the game.
but… it just doesnt want to modify the “MissingEnemies” Variable and and therefore it wont trigger the Spawn event for the missing amount of Objects.