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.

Creating 2D (or pseudo-3D) graphic adventure games is not as hard as people think.
This 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!

A script is made up of different blocks. Each block starts with a keyword, and is delimited by brackets.
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!"
	}
}

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 tree of objects like the one in the figure.tutorial_1.gif (2497 bytes)

Images are also specified for each object. You have there 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 if the item is carried by the main character.

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 just start talking a bit.

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

Once you have typed a script, the process is as follows :
- launch IndyJava as an Application, not as a browser Applet (read the FAQ about how to do this).
- go to the menu File/Import and have the engine parse your script (TUTORIAL_1.ADV in this case). If everything goes fine, you will be offered the possibility of saving the compiled game.
- save it as 001.GAG (this is very important, because this is the filename that the engine always looks for when players select File/New in the menu bar).
- start testing the game.

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

 

Next >>

Back to the main page