Chapter 9. Pathfinding

Pathfinding

In this chapter, we're going to take a close look at some essential techniques in an area of video-game design called pathfinding:

  • Randomly moving through a maze

  • Chasing a player character

  • Using line of sight in a tile-based game world

  • Finding the shortest path through an environment using the A* algorithm

But first, let's set up a game environment that's easy for your characters to move through.

Moving through a maze

One of the advantages of tile-based games is their predictable symmetry. The entire game world is composed of tiles that are the same size. You can leverage those fixed sizes to help simplify your game engine. This ...

Get AdvancED Game Design with Flash now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.