By using the Object Pool pattern, we automated the process of creating, destroying, and pooling drone instances. We can now reserve an amount of memory to spawn waves of drones while avoiding burdening the CPU. We added optimization and scalability to our code by implementing this pattern without losing readability or adding complexity.
In the next section, we will review some alternative solutions to consider; it's always a good practice to consider other options before deciding on a specific pattern.