{"id":24231525,"url":"https://github.com/shendriks/pathfinding-2d","last_synced_at":"2026-05-30T18:31:44.415Z","repository":{"id":249726292,"uuid":"832310993","full_name":"shendriks/pathfinding-2d","owner":"shendriks","description":"A collection of code examples from my blog","archived":false,"fork":false,"pushed_at":"2026-04-02T05:33:27.000Z","size":324,"stargazers_count":1,"open_issues_count":8,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-02T18:56:36.795Z","etag":null,"topics":["a-star","a-star-path-finding","blazor-webassembly","blazorgl","csharp","game-development","gamedev","kni","monogame","pathfinding"],"latest_commit_sha":null,"homepage":"https://shendriks.dev","language":"C#","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shendriks.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-07-22T18:58:31.000Z","updated_at":"2026-04-02T05:31:17.000Z","dependencies_parsed_at":"2024-10-23T23:05:40.215Z","dependency_job_id":"2c33b3f5-8c4b-4938-b943-5fc0c8a00653","html_url":"https://github.com/shendriks/pathfinding-2d","commit_stats":null,"previous_names":["shendriks/blog-code-examples","shendriks/pathfinding-2d"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/shendriks/pathfinding-2d","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shendriks%2Fpathfinding-2d","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shendriks%2Fpathfinding-2d/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shendriks%2Fpathfinding-2d/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shendriks%2Fpathfinding-2d/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shendriks","download_url":"https://codeload.github.com/shendriks/pathfinding-2d/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shendriks%2Fpathfinding-2d/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33705207,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-30T02:00:06.278Z","response_time":92,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["a-star","a-star-path-finding","blazor-webassembly","blazorgl","csharp","game-development","gamedev","kni","monogame","pathfinding"],"created_at":"2025-01-14T14:19:44.382Z","updated_at":"2026-05-30T18:31:44.392Z","avatar_url":"https://github.com/shendriks.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# A* Pathfinding in 2D Games\n\n[![.NET](https://github.com/shendriks/pathfinding-2d/actions/workflows/dotnet.yml/badge.svg)](https://github.com/shendriks/pathfinding-2d/actions/workflows/dotnet.yml)\n[![Lint](https://github.com/shendriks/pathfinding-2d/actions/workflows/super-linter.yml/badge.svg)](https://github.com/shendriks/pathfinding-2d/actions/workflows/super-linter.yml)\n\nThis is a collection of code examples from the blog series https://shendriks.dev/series/a-pathfinding-in-2d-games/\n\nIn here you'll find the following projects:\n\n| Blog Post                                                                                                                                                                                 | Projects                                                                      | Branch           |\n|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------|------------------|\n| Part 1: [A* Pathfinding in 2D Games: The Basics for a simple Top-down Scenario](https://shendriks.dev/posts/2024-07-13-a-star-pathfinding-in-2d-games-the-basics-for-top-down-scenarios/) | \u003cul\u003e\u003cli\u003e`TopDownView.Console`\u003c/li\u003e\u003cli\u003e`TopDownView.Console.Tests`\u003c/li\u003e\u003c/ul\u003e   | `main`           |\n| Part 2: [A* Pathfinding in 2D Games: A simple Top-down Scenario implemented with MonoGame/KNI](https://shendriks.dev/posts/2024-08-24-a-star-pathfinding-top-down-blazorgl/)              | \u003cul\u003e\u003cli\u003e`TopDownView.BlazorGL`\u003c/li\u003e\u003cli\u003e`TopDownView.BlazorGL.Tests`\u003c/li\u003e\u003c/ul\u003e | `main`           |\n| Part 3: [A* Pathfinding in 2D Games: Side-View](https://shendriks.dev/posts/2024-09-04-a-star-pathfinding-side-view/)                                                                     | \u003cul\u003e\u003cli\u003e`SideView.BlazorGL`\u003c/li\u003e\u003cli\u003e`SideView.BlazorGL.Tests`\u003c/li\u003e\u003c/ul\u003e       | `main`           |\n| Part 4: [A* Pathfinding in 2D Games: Addendum about Cyclic Dependencies](https://shendriks.dev/posts/2024-12-01-a-star-pathfinding-supplemental/)                                         | \u003cul\u003e\u003cli\u003e`SideView.BlazorGL`\u003c/li\u003e\u003cli\u003e`SideView.BlazorGL.Tests`\u003c/li\u003e\u003c/ul\u003e       | `grid-navigator` |\n\n## A few notes about the implementation\n\n### Code Duplication\n\nIf you compare the applications, you'll notice that all projects have\nsimilar classes like `Cell`, `Grid` or `AStarPathfinder` with quite a bit of duplicated code.\n\nDuplicated code is generally considered bad practice (see [the DRY principle](https://en.wikipedia.org/wiki/Don%27t_repeat_yourself)).\nHowever, it seems acceptable in this case because\n\n1. These are separate projects, each with its own set of requirements (e.g. a console application\n   is meant to be called once, while a MonoGame application is meant to be interactive and game-like, e.g. you can step through\n   the algorithm).\n2. Trying to avoid duplicated code by extracting superclasses into a separate project makes the relatively simple\n   examples unnecessarily complicated.\n3. The code is unlikely to change.\n\n### About not unsubscribing from Events\n\nIn general, it's good practice to unsubscribe from events when you no longer need them.\nIn this example, however, we'll skip the step of unsubscribing for simplicity's sake, because it's just one level, if you will, and the\n\"game\" is not progressing in the sense that a new level or area needs to be loaded while the current one is being unloaded, or\nnew game objects are being created or existing ones are being destroyed. The only time we would need to unsubscribe is when the\nwhole game ends, in which case everything will end up in data nirvana anyway.\n\n### Testing\n\nYou'll find a few rudimentary tests in the test projects. The coverage is probably not super high. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshendriks%2Fpathfinding-2d","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshendriks%2Fpathfinding-2d","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshendriks%2Fpathfinding-2d/lists"}