Setting up Cell2D in Eclipse IDE
Download Cell2D.
Extract the Cell2D ZIP file. Inside is a folder called Cell2D-<version>, where <version> is Cell2D's version number.
Open Eclipse IDE.
Configuring a project to use Cell2D
In the Package Explorer tab, right-click or control-click on the project that you want to use Cell2D with. Select Properties.
In the list on the left of the Properties window, select Java Build Path. In the row of tabs at the top, select Libraries.
Select Add External JARs. Navigate to the folder Cell2D-<version>/lib/ and add all of the JARs in there: lwjgl.jar, lwjgl_util.jar, jorbis-0.0.17-1.jar, and TiledReader.jar. Then, add Cell2D-<version>/natives/jinput.jar, and finally add Cell2D-<version>/Cell2D.jar.
Running a Cell2D project
Make a new folder, preferably in the folder of your Eclipse project. This folder will contain the native libraries that Cell2D, and thus your game, needs in order to run.
Now you need to copy the native libraries into your new folder.
No matter what, copy Cell2D-<version>/natives/jinput.jar. Despite being a JAR file, jinput.jar only works if it's included in the native library path, at least from my experience.
If you want your game to run on Windows (32-bit), copy the files in Cell2D-<version>/natives/windows32/.
If you want your game to run on Windows (64-bit), copy the files in Cell2D-<version>/natives/windows64/.
If you want your game to run on Mac OS X, copy the files in Cell2D-<version>/natives/macosx/.
If you want your game to run on Linux (32-bit), copy the files in Cell2D-<version>/natives/linux32/.
If you want your game to run on Linux (64-bit), copy the files in Cell2D-<version>/natives/linux64/.
In your project's
main()
method, before you callCellGame.startGame()
, callCellGame.loadNatives("<path>")
, where <path> is the path from your project's folder to the native library folder.When distributing your game, make sure to include the native library folder.
Last updated