Sign in to follow this  
mypel16000

A star Tutorials - SFML

Recommended Posts

Hi, I am developing a game in C++ with SFML. I have got to the point where I need AI movement and path finding. I have heard that the way forward is using an A star algorithm, but there seems to be such little help on the internet. I have no knowledge of advanced C++ features such as maps, search cells...

 

Does anyone have some source code I can use for my game or a good tutorial on how to do it (I don't need a tutorial on the principles, I know them; I just don't know how to implement it on C++) I found a good code from 

 

http://code.activestate.com/recipes/577457-a-star-shortest-path-algorithm/

 

It works very nicely on its own, but as soon as I bring it onto my project in CodeBlocks it shows lots of compiler errors.

 

Come on, let's get some good stuff in here so that anyone googling this problem can have some good helo

Share this post


Link to post
Share on other sites

I have no knowledge of advanced C++ features such as maps, search cells...

You also seem to have no knowledge of basic C++ features such as preprocessing, compiling and linking. Go back to the previous thread you made on A* and read the last post again. The way you are trying to integrate external code in your project is fundamentally flawed. You need to figure out how to create and use header files and put multiple source files in a project. If you don't understand advice you are getting in an existing conversation, ask questions rather than giving up and creating a new thread in hopes someone will spoon feed you the answer. Here's the main point you should be concentrating on from that last post: "It's generally a bad idea to #include a .cpp file. You should include only .h header files."

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this