Posted October 10, 2022 by watto_a
The formations for the enemy have been constructed as 3 separate arrays. One for the Green enemy, one for the red enemy and one for the purple enemy. The names and sizes of the formations will be in sync with the score value as determined previously. The amount of each array can be changed and tracked using a spawn manager.
The hardest part of creating the path was the forming of the bezier curves, but the amount of way-points within the curve can be changed in the inspector, which allows for tighter curves and free flowing enemy.
There are separate paths for the entry of the enemy when they are spawned and the enemy groups can be split between different paths. This will be an advantage when creating different levels. Once the enemy ships leave the entry path they move to the formation and become children of the relative formation, this frees them from being tracked individually using vector2.
The formation moves from side to side in the trend of the original galaga or space invaders. The speed and distance can be changed which also helps with higher levels in the game.