In this recipe, we will create a control that is going to steer an AI character. Using
Control to do this is beneficial since it can add the AI functionality and be used together with other
Controls in the game. We can use
GameCharacterControl from Chapter 2, Cameras and Game Controls for both the player and AI characters by adding
AIControl to its spatial. To get a quick and visual result, we'll apply it to the bullet-based
BetterCharacterControl class in this recipe.
We need to perform the following steps to get a basic, but functional attacking (or following) AI:
AbstractControl. The core of the recipe will be based around an enum ...