Saturday, April 09, 2011

Inkscape as Level editor

If you dont' know about Inkscape yet, it's a svg editor and if you dont' know svg its just a text based file format for describing an Image.

Now that we have that out of our way.. lets talk business. During one of they pyweek contests, i came across a discussion regarding creating a level editor for a game. And one of the participants posted saying that he is using Inkscape as level editor. I thought to myself that I should be doing it too. But I didnt' know how the parse the file, i knew it was xml but did not know the tags, attributes etc that are valid for an svg. Then i came across a svg rendering library called squrtile . I looked at the code and saw that it was pretty straight forward.

And now for the first time i have used svg as a level editor for my pyweek entry "Charged". This made it way easier to visualize what i was going to see in the game and much more organized. In fact anybody can just pick up any svg editor and start creating there own levels by checking out the levels the game has. Also i've been using inkscape along with gimp extensively since my last project. Here is how and why you can use it as level editor:

  • Open file in Inkscape
  • Open source code viewer (Ctrl+Shift+x)
  • Add key and value pairs for each object. (these can be anything but your program should use this info).
Once the above is done you have a svg file with the information that is required for placing different types of objects in the game world. Once you have this information, we can just render the corresponding objects.

I think i've gotten better at using it :) I am atleast able to make what the game requires. I have to agree though, ive' been trying to keep the art as simple as possible so i can make it look as polished as possible. Any way here are the screenshots of Charged.You can download the game from the pyweek contest site Charged. you will be able to find the windows exe as well as the source. Hope you like it.
Post a Comment