[SOLVED][LIBGDX] AI with Libgdx

I want to add gdx-ai to my existing project but I have encountered several difficulties.
I don’t know exactly what I need to do. I went to this URL:

But I don’t know how to get the actual .jar file(gdx-ai.jar) and add it to my project.

If anyone can explain it to me step by step I would really appreaciate that.

You need to update your build.gradle file, located in your project root.

In the allprojects/ext part you can define a variable to store the version number of gdx ai at one place (I’m using 1.4.0).


allprojects {
...
    ext {
        gdxVersion = '1.4.1'
+        gdxAiVersion = '1.4.0'
    }
...
}

Then you have to add a compile action to each of your projects. Here the example for the desktop project:


project(":desktop") {
    apply plugin: "java"

    dependencies {
        compile project(":core")
        compile "com.badlogicgames.gdx:gdx-backend-lwjgl:$gdxVersion"
        compile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop"
...
+        compile "com.badlogicgames.gdx:gdx-ai:$gdxAiVersion"
    }
}

Do the same for the other projects ( “core”, “android”, “html”). Note the $gdxAiVersion part, which takes your predefined version number… If you want to update to a new version, you just need to change it at one place.

When you updated the build.gradle file you can rebuild your project from command line with gradle or use the eclipse gradle tools to rebuild/refresh, if you are using eclipse. After the refresh you should be able to use the gdx-ai stuff.

Not sure if you have to provide something special for html and android versions, but it should work at least for desktop, if you add the compile line into core and desktop project. Hope this helps.

Never mind. I downloaded the .jar file from here:
http://search.maven.org/#search|gav|1|g%3A"com.badlogicgames.gdx"%20AND%20a%3A"gdx-ai"