In this chapter, we used the Strategy pattern to implement our game's first enemy ingredient, a flying, laser-shooting drone. By using this pattern, we encapsulated each variant of the drone's attack maneuvers in individual classes. This approach made our code easier to maintain by avoiding having bloated classes filled with lengthy conditional statements. Now, we can quickly write new attack maneuver variations or adjust existing ones. Hence, we have given ourselves the flexibility to be creative and test out new ideas quickly, which is a vital part of game development.
In the next chapter, we will start working on a weapon system and explore the Decorator pattern.