Creating an enemy attack

If the enemies we create are going to pose a genuine obstacle in the way of the player achieving the goals we create for them, then we will first need to give the enemies the ability to damage the player. In Chapter 9Building Smart Enemies with Artificial Intelligence, we set up the basic structure of an enemy attack pattern. It is triggered when the player enters the enemy's line of sight. We are now going to introduce a damage Component to this attack, ensuring that there is some consequence of the enemy reaching the melee range of the player.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset