A to Z guide to pathfinding with Easystar and Phaser 3

Pathfinding is a technique that consists in computing the shortest path between two points. It is ubiquitous in video games to compute the paths that AI-controlled NPCs should follow, or even to compute the path that the player character should take in games where the player doesn’t directly control the movements of the character (for example click-based games).

In this tutorial, we’ll be using the great Easystar pathfinding library to compute paths for us in a basic Phaser 3 game, and see how we can translate the paths computed by Easystar into actual smooth motions of the player character using a Phaser 3 timeline. We will used Tiled (with which I assume basic familiarity on your part) to set up the tilemap and indicate the obstacles, as well as see how to make some terrains less preferable than others by attributing costs to them.

Read more at: Dynetis Games blog.

No Comments

Leave a Reply

Gamedev.js Shop
Gamedev.js Jam 2024
Gamedev.js Survey 2023 Report
Gamedev.js Discord

Follow us

Gamedev.js Weekly newsletter

Or visit gamedevjsweekly.com directly.

Websites worth visiting

Log in

Forgot password?

Already registered? Log in


Register

Forgot password?