Skip to content
A tool for converting SVG files to box2d game levels using Scala.
JavaScript Scala HTML
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


Level editors save a lot of time during game development and especially if you are working on a physics-based game. There are many options when it comes to level editors. Here are few of them:

  • Hand-roll your own editor UI that generates a level into JSON or XML file and parser that will parse it.
  • Use existing editor such as RUBE.
  • Reuse existing UI editor (such as Flash CS or Inkscape) and write the parser and translator to convert Editor's output to the game level.

Option one is very appealing because your custom UI editor can be built-in into your game and exposed to players while options two and three are more generic solutions. This project is one possible implementation of the third option. It uses Inkscape as a level editor and has an SVG parser and code generator, both written in Scala language. The code generator generates JavaScript code for the box2dweb framework.

How to use it

  1. Create a box2d level in Inkscape. Game edit

  2. Save it as an SVG file. SVG

  3. Run the svg2phys to generate JS code for the box2dweb framework. Box2d

Live Demo

You can see the output for the above example here.

You can’t perform that action at this time.