Skip to content

C++ demo project to utilize SDL2 and Astar pathfinding algorithm

Notifications You must be signed in to change notification settings

Jouzer/pathfinding

Repository files navigation

A demo "challenge" project to implement A* pathfinding algorithm in C++, create a GUI with SDL2.

Consulted ChatGPT for a short but "difficult" assignment.

Pathfinding Algorithm Implementation
Implement a pathfinding algorithm, such as A-star, which is widely used in games for navigating characters or objects through a game world.
Key Features:
Grid-based Map: Create a simple map representation.
A-star Algorithm: Implement the A-star algorithm to find the shortest path between two points.
Visualization: Provide a visual representation of the pathfinding process.

Status at beginning; I only heard of SDL today, it sounds more interesting to me personally than doing something with an engine such as Unity or Unreal. I have created multiple ASCII grid based games/protos, and one of them had self-made "AI" the enemies trying to chase you, so the challenge is not totally foreign either

Project active working time from design to working 7½h. No prior experience working with A-star or SDL2.

Instructions for installing SDL2 libraries in Visual Studio 2022 https://www.youtube.com/watch?v=7nkKVyt0DsY
A-star pathfinding algorithm code was readily available at https://www.geeksforgeeks.org/a-search-algorithm/ , necessary changes were mostly about returning an object instead of printing the route

Sprites are opensource. Credit for sprites George Bailey https://opengameart.org/content/16x16-game-assets


About

C++ demo project to utilize SDL2 and Astar pathfinding algorithm

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages