gdquest-demos / godot-2d-tactical-rpg-movement

Grid-based movement for a Tactical RPG
Other
127 stars 22 forks source link

[REQUEST]Update the tutorial to Godot 4 and use the AStarGrid2d class #2

Open dukemagus opened 1 year ago

dukemagus commented 1 year ago

I'm submitting a...

Bug report

Feature request

Describe the problem you're trying to solve.

Godot 4 had some massive updates on its 2d feature set and API, and a powerful new class is AStarGrid2D, that is almost perfect for this kind of feature (grid based movement and pathfinding)

it will probably involve refactoring the entire pathfinder.gd script

3d12 commented 1 year ago

Hello!

I've made this update in my own fork. Since I was following this tutorial in Godot v4.0, I was able to research and make changes as I went along.

The finished implementation of Pathfinder.gd is quite a bit smaller when using AStarGrid2D, please check out my implementation and let me know if you have any suggestions for improvements!

https://github.com/3d12/godot-2d-tactical-rpg-movement/blob/update_to_godot_4.0/godot4/GameBoard/Pathfinder.gd