Pathfinding (NPC Follows Player/Aggro Monsters) - How to Make a 2D Game in Java #40
RyiSnow RyiSnow
29.9K subscribers
16,031 views
324

 Published On May 31, 2022

If you want to learn how the A* algorithm works, please check:
   • Step by Step Explanation of A* Pathfi...  

In this video, we will implement a pathfinding algorithm so NPCs/enemies can search the path and reach a specified location/target.

What we do this time:
Guiding an NPC to a different location
Letting an NPC follow you
Making monsters start attacking/chasing you

If you want to use my assets (images/maps/sound) that are used in this tutorial, here's the link:
https://drive.google.com/drive/folder...

Guidelines for using Blue Boy Adventure's code and assets:
https://docs.google.com/document/d/1q...

Timestamps:
0:00 Introduction
1:38 Creating Node class
2:50 Creating Pathfinder class
19:36 Letting NPC finds the path
35:03 Drawing the path on the screen
37:16 NPC follows the Player
39:06 Monsters get aggro and chase the Player
44:21 FINAL RESULT

show more

Share/Embed