GameGrid: Game programming with Java

Research project PHBern  
HomePrintJava-Online

JGameGrid in NetBeans

Developing more complex applications using several classes it is easier to work with a local development environment. We recommend NetBeans instead of our Online-Editor.

1. Installing NetBeans (Instructions as PDF)

You need the following components:

 
  • NetBeans 6.9.1 (for free from the webpage www.netbeans.org). We recommend the english Version "Java" including Java EE and Java ME (214 MB) or the complete version.


  • The class library JGameGrid.jar (for free from www.aplu.ch/jgamegrid)

    Unzip the file JGameGrid.zip and copy the file JGameGrid.jar out of the directory lib to your hard drive, e.g. to the directory C:\jars

 

2. Create a JGameGrid project

Start NetBeans and choose New Project  from File.


Select the category Java from Projects Java Application and click Next

 

Typ in a project name and define the project location.

 

 

 

 

Deselect Create Main Class and Set as Main Project.

Click Finish.

 

3. Including the class library JGameGrid


 

Right-click on Libraries and select Add Jar/Folder.

Add JGameGrid.jar .

 

 

4. Creating a new class

Right-click on <default Package> . Select New - Java Class

Typ in a class name and click on Finish.
A project can contain several classes.

 

 

5. Adding Sprites

Create a directory sprites in your NetBeans project directory src.

All pictures used as characters or background need to be placed inside this directory.

 

6. Compiling and executing the program


Right-click the class and select Run File.  

 

7. Saving the game as a self-executing jar-file


 

Right-click on the project name and select Clean and Build. Choosing this option the compiled class and the directroy sprites are added to the jar-file. This file can be found in the NetBeans project directory dist.


 

Instructions as PDF: GameGridNetbeans.pdf