This repo is a port of Godot's own navigation_astar example to C#.
I generally tried to follow the Godot style guidelines, except for BSD-style brackets. I just strongly prefer the Java variant of K&R I'm used to.
Character.cs and PathfindAstar.cs are both new, ports of their GDScript analogs. There are new nodes in the main Game scene suffixed with "Cs" that use them, while the original nodes are still there but disabled. I tried to keep the method names and order consistent to make it easier to compare them.
- Practice; it's been a couple years since I used Godot.
- Testing C# viability; seems like it works, but I ran into the renaming issue, and other quirks, like you have to rebuild before exported properties are updated. Some APIs are a bit rough too, due to a lack of a Vector2Int-style class. Pooled arrays are missing, so there's a fair bit of juggling between lists and arrays. I'm still not 100% clear when to use C#'s List vs Godot's Array vs C#'s Array.
- I plan on using the C# version for another project.
- Converting code from one language to another is kinda fun.
Same as the original repo at time of writing: MIT.
Everything below this line is from the original README.
This is an example of using AStar for navigation in 2D, complete with Steering Behaviors in order to smooth the movement out.
Language: GDScript
Renderer: GLES 2
