Now that you have programmed the player’s attacks, it is time to program the computer attack code. This is slightly more complicated than the player’s attack code because it means the computer needs to find out which unit is selected, which unit it should attack. It will also need to find out the results of the attack and play them out on screen.
Because many aspects of the code is reused, we will only be covering the combat aspect in detail; for any changes to other aspects of the code, we will provide a quick overview of what has changed.
First you need to open the file that we have already created with all the previous changes implemented and our other changes. The file is called Combat3.mfa and can be found in the Examples ...