O'Reilly logo

Cocos2d Cross-Platform Game Development Cookbook - Second Edition by Siddharth Shekar

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 6. AI and A* Pathfinding

The topics covered in this chapter are as follows:

  • Patrol enemy behavior
  • Projectile shooting enemy
  • Chasing enemy behavior
  • A* pathfinding

Introduction

It is said that to be an awesome hero, you need to fight awesome enemies. In games, we make enemies by adding different kind of behaviors, starting from the simple roaming behavior to bosses who have a range of moves and patterns that keep the player on their toes at all times.

In this chapter, we will discuss how to add enemy Artificial Intelligence (AI) behaviors to make the enemies react to the player's moves.

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