Artifact [e79fcbed8a]
Not logged in

Artifact e79fcbed8a30d86e16353bb90e353b7bda1f54f0:

Wiki page [HowToEditLevels] by devnewton 2012-06-01 20:56:13.
D 2012-06-01T20:56:13.960
L HowToEditLevels
P f501530075cc2040ff43c60eb586ca0205c2d1bf
U devnewton
W 3948
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>
<li>game/data/default_level_data contains gfx and sound usage in all levels.</li>
<li>game/data/main_menu contains gfx for the.. main menu.</li>
<li>game/data/twl contains gui data for the options menu.</li>
<li>game/data/quests contains levels data.</li>
</ul>

<h2>Quests</h2>

A quest is a set of levels. Every quest has his own folder in game/data/quests.

A quest folder has the following structure:

<ul>
<li>game/data/quests/questname/bt-quest-off.jpg and game/data/quests/questname/bt-quest-on.jpg are the button gfx for the quest menu.</li>
<li>game/data/quests/questname/completed.jpg is the image display when player complete all quest levels.</li>
<li>game/data/quests/questname/levelN 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.
Z a75554b5f5f84e91d42198c67b209a2e