The enemy release is controlled by two flags and a delay from vsyncCounter
When a round starts or continues after ladybug dies; both flags (enemyReleaseEnable, enemyTimerZero) are cleared
When the timer hits top left corner and if all enemies are not yet active then enemyReleaseEnable is set and the enemy release warning is sounded
When the timer hits top center (zero) and if the enemyReleaseEnable is set then enemyTimerZero is set
In the game main loop a call to enemyRelease function checks for both flags are set and then checks the vsyncCounter and 15 = enemyNumber (0-3) * 4 and if so releases an enemy and clears both flags
After release it checks and if all enemies are not spawned it spawns another into the center box else it enables the center vegetable bonus
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
I think this logic is sound and should function as I originally intended but if anyone spots a mistake please let me know thanks
When a round starts or continues after ladybug dies; both flags (enemyReleaseEnable, enemyTimerZero) are cleared
When the timer hits top left corner and if all enemies are not yet active then enemyReleaseEnable is set and the enemy release warning is sounded
When the timer hits top center (zero) and if the enemyReleaseEnable is set then enemyTimerZero is set
In the game main loop a call to enemyRelease function checks for both flags are set and then checks the vsyncCounter and 15 = enemyNumber (0-3) * 4 and if so releases an enemy and clears both flags
After release it checks and if all enemies are not spawned it spawns another into the center box else it enables the center vegetable bonus
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
I think this logic is sound and should function as I originally intended but if anyone spots a mistake please let me know thanks
Statistics: Posted by lovebug — Mon Feb 12, 2024 9:25 am