Game balance: Powerup duration
Objective: Find a powerup duration that is an incentive yet keeps the game challenging.
Powerup duration must be determined based upon the desired game difficulty and the frequency of powerup spawn. The game difficulty is tied to the enemy spawn rate and the player velocity. If you want to make the game easier then decrease the power up spawn rate of enemies and increase the duration of the powerup. In the example above, the spawn rate of 3–7 seconds feels too fast since the powerup duration is 5 seconds. With the enemies spawning every 5 seconds, the game feels to easy. The duration of the powerup should be greater than both the enemy and powerup spawn rate, otherwise the powerup looses its importance.
In the example above the difficulty has been increased by spawning enemies every 3 seconds and slowing the player movement from 5 to 3.5 units per second. A slower powerup spawn rate of 8–16 seconds makes the acquisition of the powerup less frequent. The slower player velocity makes powerups harder to acquire, increasing the urgency. These settings feel more entertaining with an appropriate difficulty. The Player variables _velocity and _tripleShotDuration and SpawnManager variables _enemySpawnRate and _powerupSpawnRate use [SerializeField] to enable adjustments in the inspector by the developer during play testing. In summary, the duration of powerups must be balanced with other variables controlling game difficulty to produce a rewarding experience for the player.