# Setting up Cell2D in NetBeans IDE



1. Download Cell2D.
2. Extract the Cell2D ZIP file. Inside is a folder called &#x43;_&#x65;ll2D-\<version>_, where \<version> is Cell2D's version number.
3. Open NetBeans IDE.

### Creating a library for Cell2D

1. Go to **Tools > Libraries**.
2. Select **New Library**. Name the new library "Cell2D."
3. In Cell2D's **Classpath** tab, select **Add JAR/Folder.** Navigate to the folder &#x43;_&#x65;ll2D-\<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 &#x43;_&#x65;ll2D-\<version>/natives/jinput.jar_, and finally add _Cell2D-\<version>/Cell2D.jar_.
4. In Cell2D's **Sources** tab, select **Add JAR/Folder** and add the folder &#x43;_&#x65;ll2D-\<version>/src/_.
5. In Cell2D's **Javadoc** tab, select **Add ZIP/Folder** and add the folder &#x43;_&#x65;ll2D-\<version>/javadoc/_.

### Configuring a project to use Cell2D

1. In the **Projects** tab, right-click or control-click on the project that you want to use Cell2D with. Select **Properties**.
2. In the list on the left of the Project Properties window, select **Libraries**.
3. In the **Compile** tab, select **Add Library**. Select **Cell2D** from the list of libraries.

### Running a Cell2D project

1. Make a new folder, preferably in the folder of your NetBeans project. This folder will contain the native libraries that Cell2D, and thus your game, needs in order to run.
2. Now you need to copy the native libraries into your new folder.
   1. No matter what, copy &#x43;_&#x65;ll2D-\<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.
   2. If you want your game to run on Windows (32-bit), copy the files in &#x43;_&#x65;ll2D-\<version>/natives/windows32/_.
   3. If you want your game to run on Windows (64-bit), copy the files in &#x43;_&#x65;ll2D-\<version>/natives/windows64/_.
   4. If you want your game to run on Mac OS X, copy the files in &#x43;_&#x65;ll2D-\<version>/natives/macosx/._
   5. If you want your game to run on Linux (32-bit), copy the files in &#x43;_&#x65;ll2D-\<version>/natives/linux32/._
   6. If you want your game to run on Linux (64-bit), copy the files in &#x43;_&#x65;ll2D-\<version>/natives/linux64/._
3. In your project's `main()` method, before you call `CellGame.startGame()`, call `CellGame.loadNatives("<path>")`, where \<path> is the path from your project's folder to the native library folder.
4. When distributing your game, make sure to include the native library folder.
