GameGrid: Game programming with Java

Research project PHBern  
HomePrintJava-Online

Online-Editor

The Online-Editor enables the user to develop, compile and execute Java programs on our webserver without having to install Java SDK and any development environment including the necessary class libraries. There is also a wide variety of Sprites on our webserver. They can be used as characters or backgrounds.


 


To start the Online-Editor click the button "Start Online-Editor" at the bottom of the left menu.

The Online-Editor offers a range of different program templates. For game programming the template GameGrid is used.

Inside the editor window the basic structure of a GameGrid programm is shown.

 

 

Clicking on the button "Compile" the program code is compiled.

The compilation is executed on our webserver.


 

After the compilation a message window at the bottom of the Online-Editor shows the following text:

"Compilation successful"

To run the program click on
"Run MyJGame".

The compiled program is downloaded and executed on the local machine. In this case, an empty and black game window should appear.

If the execution of the program fails please check all settings described in the Browser-Setup

 

 


 

Adding a background picture to your program:
Add the passage "sprites/riff.gif" to the fourth line.

Compile and run the program again. This time the grid should show a background image of a reef.

The system of the Online-Editor is similar to a real editor. Any error of the program code is shown in the message window after each compilation.

Already written source code can be copied into the editor (copy = ctrl+c, paste = ctrl+v, cut = ctrl+x). Java key words are marked in bold and blue, comments (//... or /*...*/) green and strings appear blue.

Clicking the button Help in the upper right corner of the editor the class documation of the class JGameGrid can be viewed. In it each method with its specification can be found.