Devastro had a built-in level editor and it was the best thing ever.
For Superforce I did the same thing. Putting extra time into making an editor is paying off. Making levels is really fun.
Superforce levels use tile-based maps with freely moving objects on top. The editor has three modes to allow me to edit everything in a single view.
- Object editing mode – for placing enemies and pickups on the map. Objects can be selected and dragged around.
- Tile editing mode – editing the map itself. The map is tile based. I first tried to use Tiled for editing the map but the TMX file format is too complicated for my needs and the workflow was really awkward.
- Collision mask editing mode – editing materials for tiles. I can draw with a “grass” brush over one tile and all the tiles of the same type get updated instantly. The mask is used for collision detection (water vs. terrain) and also for creating visual effects. Bullets hitting water create a little splash; when they hit grass, a little bit of dirt flies up; hitting a metal object creates sparks etc.
Pressing “P” switches into playing mode, so I can playtest immediately. ESC resets the game and goes back to editing mode.
The user interface is based on the IMGUI concept: all UI elements are rendered and evaluated at the same time and it’s all done on each frame. There are buttons, lists, draggable items, multi-selection for objects, undo/redo, native Mac OS X dialogs for saving, keyboard shortcuts etc.