Phase 2: Balanced Spawning
Objective: Create balance logic for spawning collectables
For the balanced spawning, we take a look at the 8 collectables and set the value on how often they can spawn. We set this on a scale of 1 to 100 (0 to 99) and set them in order of most to least probable.
Collectables and Values
- Ammo: 30
- Tripleshot: 20
- Speed: 20
- Danger: 10
- EMP: 5
- Shield: 5
- Chaos: 5
- Health: 5
Now that the values are set the next thing is to open the SpawnManager script and within the Spawning Coroutine, change the random range from simple(0,8) to the higher value for balancing(0, 100). Notice the values are always 1 higher on integer random ranges but this will give a between 0 and 99 result. Next set a multi if else statement to account for the 8 range and change the instantiation to use the relevant integer variable.
In the next post, we will look at setting a single shot shield on our original enemy.