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
hierarchy, a tree of objects like the one in the figure.
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 just start talking a bit when the player tries "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, and try to run it with the engine.
Once you have a script, the process is as follows :
You will be able to move Indy around with the mouse, and try one command : "Use Whip".