Svg made with the 0.2.0 version of svg2lvl are not compatible with this version of svg2lvl.
- 1 Windows installation
- 2 Linux & Mac OS X installation
- 3 Tutorial: First steps
- 4 Tutorial: More advanced topics
- 4.1 Other blocks properties
- 4.2 Other entities properties
- 4.3 Other level properties
- 4.4 Layers
- 4.5 Inkscape tricks
To install Inksmoto level editor 0.4.0 on a Windows box, just double-click on the Inkscape-0.45.1_svg2lvl-0.4.0_win32.exe installer.
Linux & Mac OS X installation
To install the required softwares on an Linux Ubuntu box (Festy Fawn):
$ sudo apt-get install inkscape python python-tk python-xml
To install the required softwares on a MacOS X box, use Fink and/or get the .dmg on the Internet. (TODO: get the exact procedure)
$ wget http://download.tuxfamily.org/xmoto/svg2lvl/0.4.0/svg2lvl-0.4.0.tar.gz $ tar zxvf svg2lvl-0.4.0.tar.gz $ cd ~/svg2lvl-0.4.0/ $ mkdir -p ~/.inkscape/extensions/ $ cp -f * ~/.inkscape/extensions/
Tutorial: First steps
This part of the tutorial learns the basics to be able to create a level.
Warning: This tutorial is for the release 0.4.1 which will be release soon (but not before the 20th of august...)
Warning: If you use the 0.4.0 release, this tutorial do not apply (but there's some similarities).
Quick look at inkscape
Here is the list of useful tools from Inkscape to create Xmoto levels:
- The selection tool
- The path editing tool
- The zoom in/out tool
- The rectangle tool
- The circle tool
- The star tool
- The hand draw tool
- The bezier curves draw tool
- The Xmoto properties menu
The Xmoto extensions
The Xmoto extensions from the Effects menu allows you to set Xmoto properties to Inkscape objects in the drawing.
Here is a description of the different entries of the Xmoto menu:
- Remove the edge around the block: Remove the upper and/or the down edge of the selected blocks.
- Add an edge around the block: Add an edge on the upper and/or down edge of the selected blocks. The up and down side can have a different edge texture.
- Change Block Texture: Change the texture of the selected blocks.
- Change Block Type: Convert the selected shapes into Xmoto blocks (normal, background, dynamic, dynamic background). You can also assign them a texture.
- Change block physic params: Change the physic parameters of the selected blocks (currently, only the block friction).
- Convert into Strawberry: Convert the selected shapes into a strawberry.
- Convert into End of level: Convert the selected shapes into a end of the level.
- Convert into Particle Source: Convert the selected shapes into a particle source (fire or smoke).
- Convert into Player Start: Convert the selected shapes into the start position of the player.
- Convert into Sprite: Convert the selected shapes into a sprite (with many parameters for the sprite).
- Convert into Wrecker: Convert the selected shapes into a wrecker.
- Set layers properties: Set which layers are for background and what are their scrolling parameters.
- Set sky properties: Change the sky of the level.
- Set level properties: Mandatory options for the level, like its name and id.
- Set other level properties: Allow sprite replacement of the /strawberry/wrecker/end of level/. Add a music to the level.
- Inksmoto tutorial: Display the link of this tutorial on the wiki.
- Launch level in X-Moto: Launch the level in Xmoto.
- Show the object informations: Show the Xmoto properties of the selected shapes.
- Update X-Moto menus: Get new textures and sprites from the Internet.
- Convert into Zone: Convert the selected shapes into zones (currently, only rectangular zones are used).
Drawing a simple level
Let's draw a simple level using only the Rectangle, Circle and Star tools.
First, put the zoom of Inkscape to 100% (defaulted to 35% when you create a new svg), then draw your level.
Set level properties
Now that the shapes of the level are drawn, we have to assign them Xmoto properties. For example, we want some shapes to be solid blocks, some others to be background blocks, ...
To do that, select the shapes we want to update, then go to the Xmoto effect menu and use the menu entry "Effects->X-moto->Blocks->Change Block Type".
- For example, to put the ground of our tutorial level, select the ground blocks and convert them to xmoto blocks.
- The block properties window opens in which we choose that our blocks will be normal blocks with the texture glass1:
- Then the level updated in Inkscape (shapes with an Xmoto properties are colored, the color depends on the property):
Save the level
Now that our level is drawn and its shapes have Xmoto properties, we have to set the properties of the level, like its name, author, ...
- Use the Xmoto menu entry "Effects->X-moto->Level->Set level properties":
- This windows will popup:
- Entries in this window (bold ones are mandatory):
- smoothitude: The higher this parameter, the smoother the level (9 by default).
- lua script: If your level has a lua script, enter the lua file with its full path.
- level id: The id of the level (only letters and digits, no space).
- level name: The real name of the level.
- author: The author of the level (you).
- description: A message to add to the level.
- border texture: Choose the texture which be displayed around the level.
Test it in Xmoto
Now our level is ready to be tested in Xmoto.
- Just use the Xmoto menu entry "Effects->X-moto->Other->Launch level in X-moto":
- This window will popup:
- If the Xmoto executable is present in your PATH (under Linux and MacOSX), you don't have to fill the parameter. If you're under Windows or you want to use a specific Xmoto executable, then enter your Xmoto executable with its full path.
- Here is the level under Xmoto:
- When you launch the level in Xmoto, the file last.svg and last.lvl are created in the Inkscape extensions directory (~/.inkscape/extensions (Linux & MacOSX) C:\Program Files\Inkscape\share\extensions (Windows)). You can get the svg and the lvl this way. You can also save the svg and the lvl separately using 'File'->'Save As...' and choosing the appropriate file format.
Svg file of the tutorial
Here is the corresponding svg file of the level in its current state : Media:Tutorial1.svg
Tutorial: More advanced topics
In this part, we will see how to add more advanced stuffs to the level in order to create better levels.
Other blocks properties
Different block types
There's four type of blocks:
- Normal: The blocks which collide with the biker.
- Background: Blocks behind the biker.
- Dynamic: Blocks which collide with the biker, they can be moved using scripting.
- Dynamic background: Blocks behind the biker which can be moved using scripting.
You can change the type of blocks by selected them then use the menu entry "Effects->X-moto->Blocks->Change block type":
- For example, to convert the three background blocks into dynamic background block, select them and convert them.
- The block properties window opens in which we choose that our blocks will be dynamic background blocks. Note that we don't update the blocks texture:
- The resulting level in Inkscape:
Now we can add a script to this level in order to move the dynamic background blocks using the menu entry "Effects->X-moto->Level->Set level properties"
In order to increase the visual quality of your level, you can add edges to the blocks. An edge is a texture which is draw on the border of the block.
- See this screenshot of a level with edges on its blocks:
You can add an edge texture to the upper side of a block and/or to the down side. You can add a different or the same texture to the upper and the down side of a block.
You can also remove an edge to a block after putting it using the menu entry "Effects->X-moto->Blocks->Remove the edge around the block".
- For example, to add some edge texture to the ground blocks, select them then use the menu entry "Effects->X-moto->Blocks->Add an edge around the block":
- The block's edge properties window opens in which we choose that our blocks will have the 'bluen' texture on both their upper and down sides:
- The resulting level in Inkscape (note that blocks with an edge texture have a green border):
- The resulting level in Xmoto:
You can change the basic behaviour of blocks' physic. For the moment the only custom parameter is the block grip which change the grip of the bike on the block. This parameter is useful to create 'ice' blocks.
To update a block physic params use the "Effects->X-moto->Blocks->Change block physic params" menu entry after selecting the blocks you want to update.
Other entities properties
There's six different type of entities:
- End Of Level
- Particle Source
- Player Start
There's two type of particle sources:
The particles don't interact with the bike, they are only cosmetic effects.
Select the objects you want to transform into particle sources then use the "Effects->X-moto->Entities->Convert into Particle Source" menu entry.
A window will popup which allow to choose between Fire and Smoke.
- Here is the level with particle sources in it (the orange circles):
- Here is the level in Xmoto:
When you transform an object into a sprite with the menu entry "Effects->X-moto->Entities->Convert into Sprite", this window pops up. It allows you to choose the sprite texture and change some of its parameters.
- Sprites can improve the visual of the level by adding a mood to it. For example this level is a Sonic one, so there's plenty of sprites inspired from the Sonic universe.
- By changing the z value of a sprite you can put sprites in front or in back of the player.
- By changing the rotation angle value of a sprite, you can turn you sprite in other directions.
- You can also reverse the sprite on its x axis with the reverse the sprite button.
- You can change the size of a sprite by changing the width and height of a sprite.
- When you change the size of a sprite, you can also change it collision radius to reflect its new size if it's a sprite which collides with the biker.
Strawberry, End Of Level, Player Start and Wrecker have no special parameters.
Other level properties
You can change the default sky and its parameters with this menu entry: "Effects->X-moto->Level->Set sky properties"
You can just change the sky texture by selecting it in the list of available textures.
You can also change the sky parameters by clicking the Use parameters button.
- Zoom: you can change how the sky texture is zoomed.
- Offset: you can change how fast the sky scrolls.
- Colors: you can change the texture color and alpha.
You can also add a drifted sky on top of the sky. A drifted sky is a second transparent sky on top of the existing one. The drifted sky scrolls at a different speed than the existing sky.
You can add it by clicking the Drifted sky button. Then you can change its parameters:
- Zoom: you can change how the drifted sky texture is zoomed.
- Colors: you can change the texture color and alpha.
Theme replacement & Music
You can update the sprites of the defaults Xmoto elements like the strawberries, the flower, the wreckers and the stars shown when a strawberry is picked. This window is available from "Effects->X-moto->Level->Set other level properties".
You can also choose a music which will be played while riding the level.
- Here the strawberries and the stars are replaced by flowers:
- Here the end of level is replaced by a Sonic panel:
- Here the wreckers are replaced by robot fishes:
- Here the strawberries are replaced by rings:
See the Others_tips_to_make_levels#Layers page for a description of layers.