Editing Newton Adventure level is a two step procedure. First you need to create the level data according to the game data structure, then rebuild the game (see [BuildHowTo]).

Once you have setup levels according to this structure, you can test it : [HowToTestLevels]

<h1>Game data structure</h1>

Surprisingly, game data reside in the game/data directory. It contains the following files:

<ul>
<li>Files at the root of game/data are common musics, sounds and gfx usable virtually anywhere in the game.</li>
contains gfx and sound usage in all levels.</li>
contains gfx for the.. main menu.</li>
contains gui data for the options menu.</li>
contains levels data.</li>
</ul>

<h2>Quests</h2>

A quest is a set of levels. Every quest has his own folder in

A quest folder has the following structure:

<ul>
and are the button gfx for the quest menu.</li>
is the image display when player complete all quest levels.</li>
folders contains levels data.</li>
</ul>

<h2>Levels</h2>

Levels folder contains:

<ul>
<li>A *.tmx file where position and properties of all level objects are stored. This "level map" is editable with the level editor included with game sources.</li>
<li>Some additional data, gfx or sounds, specific for this level.</li>
<li>A minimap.png gfx generated by the level editor.</li>
</ul>

<h3>Level map</h3>

The level map is a *.tmx file. A tmx file contains a tileset and a tilemap.

The map and each tile have a set of properties (a property is a name and a value).

<h4>Map properties</h4>

<verbatim>
newton_adventure.background => an png or jpg filename of the level background image.
</verbatim>

<verbatim>
newton_adventure.music => an ogg filename for the music played during level.
</verbatim>

<verbatim>
newton_adventure.rotate_gravity_possible => boolean value ("true" or "false") indicating if gravity can be rotated in this level
</verbatim>

<verbatim>
newton_adventure.mummy
newton_adventure.bat
newton_adventure.explosion
newton_adventure.fireball
newton_adventure.hero

=> gif or nanim filename for sprites animations
</verbatim>

<verbatim>
newton_adventure.axe
newton_adventure.mobilePikes
newton_adventure.door_to_bonus_world
newton_adventure.door_to_bonus_world_open
newton_adventure.door
newton_adventure.door_open
newton_adventure.key
newton_adventure.apple
newton_adventure.coin
newton_adventure.compass
newton_adventure.activator1.on
newton_adventure.activator2.on
newton_adventure.activator3.on
newton_adventure.activator1.off
newton_adventure.activator2.off
newton_adventure.activator3.off
newton_adventure.memory_activator.hidden
newton_adventure.blocker1
newton_adventure.blocker2
newton_adventure.blocker3

=> png, jpg, gif or nanim filename to change object image/animation
</verbatim>

<strong>This filenames should not include path. The file is first searched in the level directory then in the default_level_data folder.</strong>

<h4>Tile properties</h4>

Each tile is an object in the game. The type of object is determined by the newton_adventure.type property. To find what types are available, check an existing level or the method initFromTile in the World.java file.

<h5>newton_adventure.gfx</h5>

Platform tiles accept this property: it indicates a png, jpg, gif or nanim filename that will be used as texture or animated texture.

<h5>newton_adventure.friction</h5>

Platform tile friction can be changed, default is 10, increase or decrease to get sliding or hard platform.

<h5>newton_adventure.zorder</h5>

Set order of drawing, lower first.