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
Game data structure
Surprisingly, game data reside in the game/data directory. It contains the following files:
- Files at the root of game/data are common musics, sounds and gfx usable virtually anywhere in the game.
- game/data/default_level_data contains gfx and sound usage in all levels.
- game/data/main_menu contains gfx for the.. main menu.
- game/data/twl contains gui data for the options menu.
- game/data/quests contains levels data.
A quest is a set of levels. Every quest has his own folder in game/data/quests.
A quest folder has the following structure:
- 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.
- game/data/quests/questname/completed.jpg is the image display when player complete all quest levels.
- game/data/quests/questname/levelN folders contains levels data.
Levels folder contains:
- 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.
- Some additional data, gfx or sounds, specific for this level.
- A minimap.png gfx generated by the level editor.
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).
newton_adventure.background => an png or jpg filename of the level background image.
newton_adventure.music => an ogg filename for the music played during level.
newton_adventure.rotate_gravity_possible => boolean value ("true" or "false") indicating if gravity can be rotated in this level
newton_adventure.mummy newton_adventure.bat newton_adventure.explosion newton_adventure.fireball newton_adventure.hero => gif or nanim filename for sprites animations
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
This filenames should not include path. The file is first searched in the level directory then in the default_level_data folder.
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.
Platform tiles accept this property: it indicates a png, jpg, gif or nanim filename that will be used as texture or animated texture.
Platform tile friction can be changed, default is 10, increase or decrease to get sliding or hard platform.
Set order of drawing, lower first.