O'Reilly logo

AdvancED Game Design with Flash by Rex van der Spuy

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 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 ...

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