Next >>

indy_logo.gif (3362 bytes)

Step 1: the "Hello World" adventure

Indy Java is not just a game. It is a development tool in itself, since it can read game scripts and compile them, to be played later by end-users. The games it produces are of the kind you saw in the accompanying demo, known as "old style graphic adventure games" typical of the beginning of the 1990's. If you don't like the genre, you should not be reading any further!

So you want to produce your own game and get the admiration of the whole Net? Creating 2D (or pseudo-3D) graphic adventure games is not as hard as people think. The IndyJava system is based upon a script (a text file) that describes every element in the game. Such files have *.ADV extension and can be created with any text editor. The syntax is straightforward, as you will see. It has no similarities with Java. No Java knowledge required!

An IndyJava script is made up of different blocks. Each block starts with a keyword, and is delimited by brackets "{" and "}" .
The simplest possible script is as follows.

ROOM main
{
	ITEM Indy		// My hero   :)
	{
		ANIMATION
		{
			0  0  "gr/indy_d.gif"  1
			0  1  "gr/indy_r.gif"  1
			0  2  "gr/indy_u.gif"  1
			0  3  "gr/indy_l.gif"  1
			1  0  "gr/indy_wd.gif" 4
			1  1  "gr/indy_wr.gif" 6
			1  2  "gr/indy_wu.gif" 4
			1  3  "gr/indy_wl.gif" 6
			2  0  "gr/indy_td.gif" 7
			2  1  "gr/indy_tr.gif" 4
			2  2  "gr/indy_tu.gif" 1
			2  3  "gr/indy_tl.gif" 4
		}
		POSITION { 170 130 0 }     // Initial position in this room
		ITEM whip
		{
			ICON { "gr/whip.gif" }
		}
	}
}

COMMAND use whip      // A command trigger
{
	SAY indy "Hello world!"
}

My goal was for IndyJava to be simple and elegant. Overall, the whole script is just the description of a single ROOM, where we can find one familiar character, who is carrying an ITEM.So, this script actually describes a hierarchy, a tree of objects like the one in the figure.tutorial_1.gif (2497 bytes)

Within each object, its properties can be defined in inner blocks, like POSITION and ANIMATION, delimited by brackets. Here, you have the full set of images needed to animate the Indy character. For now, don't pay attention to the numbers that appear next to each image.
Every object can also have an ICON associated to it, if you wish. This icon will be displayed only when the item is carried by the main character.

An adventure game needs to react to the commands entered by the player. The COMMAND block first specifies the sentence you want to react to. Then the consequences are defined in a block of instructions. Here, the character will talk a bit when the player tries to "use whip".

Notice that uppercase and lowercase letters are equivalent. Also notice that comments start with "//" .

This is it! Type this script in a text file, save it as TUTORIAL_1.ADV, and then try to run it with the engine.


Once you have written a script, the process is always as follows :


You should be able to move the hero around with the mouse, and try one command : "Use Whip".

Hello World screenshot

Next >>

Back to the main page