Getting Started
From Jig
Getting up and running with JIG is relatively simple and only requires a couple of steps. This page will walk you through everything you need to know to setup the JIG engine with one of the two popular Integrated Development Environments for Java. JIG works with both Netbeans and Eclipse.
Contents |
Download Files
The first thing you need to do is download the required software.
- Download and install Netbeans or Eclipse if you haven't already done so
- Download the latest version of JIG at the Downloads page.
Start a Project
Consult the following sections for how to setup a JIG project with your IDE.
Start a Project with NetBeans
- Get a copy of the most recent JAR of the JIG engine.
- Start NetBeans.
- Select New Project from the File menu.
- Choose 'Java' in the Category section and 'Java Application' in the Projects section.
- Name the project and select Finish.
- Find the 'Projects' pane of the GUI's tabbed pane (by default, it is in the upper left).
- Right-click the 'Libraries' icon and select 'Add JAR/Folder'.
- A file browser window will pop up. Select the JIG JAR file (jig.jar) at whatever location you placed it at, and select 'Open'.
Start a Project with Eclipse
- Get a copy of the most recent JAR of the JIG engine.
- Start Eclipse.
- If this is your first time running eclipse, you may need to setup a 'workspace'. A workspace is simply a folder that contains all the info on the projects you are working on. Simply create a new folder and select it as your workspace.
- Click the x at the top of the 'Welcome' screen.
- Go to the file menu and click New -> Java Project
- Give the project a name
- Ensure the default JRE is at least Java 1.5 and click the next button
- Click the Libraries tab, select Add External JARs and select the JIG jar you downloaded.
- Click finish
Using your Project
Your project is now set up to use the JIG engine. You will need to import the appropriate packages to make use of the engine classes. If you want to view the source code for the engine, you can expand the 'Libraries' icon (click the '+' symbol to the left of it), then do the same with the JAR file (jig.jar). This will show you all the packages contained in the JAR, so you can browse the tree to find any particular source code you are looking for. Note that you cannot make any changes to the JIG engine - all files in the JAR are read-only.
After you have a project setup, you can start to add your own classes or edit the ones given to you in the curriculum.
Learn More
Now that you got a basic project going, you might want to try some of these other resources.
- Tutorials - Tutorials on how to do some basic games
- Demos - Various game demos
- Adding Sound Libraries - Info on adding .ogg or .mp3 file support.
Packaging Your Game
After you have your game completed you will probably want to distribute it to other people. The best way to do this is create a JAR file and zip everything up. To do this in Eclipse:
- Create a file named manifest.mf with the following text. Make sure you have a extra line after the last line and that you replace the main class line with the location of your main class.
Manifest-Version: 1.0 Class-Path: . jig.jar Main-Class: mypackage.MyClassName
- Open your project
- Right click your project and select Export
- Select Java -> JAR
- Select all the files you want to include
- You will want to check the include source button if you are submitting to a teacher
- Select a location for your JAR to be put
- Select use a existing manifest file and browse to the file you created.
- Click Finish
- Put a copy of the JIG jar in the same directory as your jar
- If you can run the game by double clicking your jar, then it is setup correctly
- You can now distribute a zip file with both JARs in it.
