We've now configured the zombie to display the selected word, and also to add text stylizations based on player input. However, we still haven't linked player input through the Typer class (coded in the last chapter) with the zombie NPC. Let's do this now by adding a new function to the EnemyAI class, namely UpdateTypedWord. This function compares the typed word with the associated word to determine the extent of a match. The purpose is twofold--firstly, to generate the MatchedWord string and highlight the typed portion of the AssocWord, and secondly, to fire a word matched event (OnTypingMatched), which causes the zombie to die. Consider the following code:
//------------------------------------
public void UpdateTypedWord()
{
//If not chasing or attacking, then ignore
if(ActiveState != AISTATE.CHASE &...