Game Development Reference
In-Depth Information
Adding Box2D dependency in Gradle
Wait a minute, we have not yet added Box2D at project creation, and so now we
have to add it manually. Everything in a Gradle-based project is managed by
build.
gradle
in the project root. Go to the
C:/libgdx
folder and open the
build.gradle
file with a text editor such as Notepad or WordPad.
Next, add the lines of code, given in the following section, to the
build.gradle
to
add Box2D dependency to our project:
• To add the desktop dependency, use this:
project(":desktop") {
apply plugin: "java"
dependencies {
compile project(":core")
compile "com.badlogicgames.gdx:gdx-backend-
lwjgl:$gdxVersion"