O'Reilly logo

Practical Android 4 Games Development by J. F. DiMarzio

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 7

Adding Basic Enemy Artificial Intelligence

The artificial intelligence (AI) of the enemy will define how the enemy attacks the player and how easy or difficult the game is for the player to win. It would be easy to create an AI that anticipates every move of the player by intercepting the listener calls from the player to touchListener. However, that would not make a fun experience for the player, and your game would not be very fulfilling. The enemies that you created in the preceding chapter need some kind of plan of attack by which to engage the player and create a satisfying gaming experience.

In this chapter, you are going to add the three distinct AIs for the three different enemy types that were discussed in Chapter 2 and created ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required