davecusatis / a-star-sharp Goto Github PK
View Code? Open in Web Editor NEWA small, easy to understand C# implementation of the A Star pathfinding algorithm for 2D grid based applications.
License: MIT License
A small, easy to understand C# implementation of the A Star pathfinding algorithm for 2D grid based applications.
License: MIT License
Can you add a license to it please?
Hey I really love your A* implementation, thanks you, it is very lightweight and exactly what I was looking for!
But I quickly found out that the end location is not ALWAYS set to walkable if your MapData sets it to not walkable.
Even tho you wanted the end locaton to be ALWAYS walkable judging by the code:
Node end = new Node( new Vector2( (int)( End.X / Node.NODE_SIZE ), (int)( End.Y / Node.NODE_SIZE ) ), true );
but you actually did not implement an override to make sure that it is actually walkable.
if ( !ClosedList.Contains( n ) && n.Walkable )
that means if my MapData says the NPC is not walkable because he has collision obviously,
it won't find a path.
To get around this I would need to know the end position before I define my MapData and set the end location to walkable, but what I'm looking for is only defining the MapData once without knowing the end location so I don't have to make a lot of different MapDatas just so I can find another location on the same map.
I know that in most cases you want to know if the end is actually reachable but in my case I know already that the end is always walkable, but I don't want to make thousands of new MapDatas just to overwrite the collison, I mean I'm doing that right now and it is turbo slow..
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.