First, no platform game can be made without a Level Editor.
So let’s start with that tool. Why do I create my own editor ? Mainly because what I’ll code here can be used in the game itself.
The way the tiles are drawn on the scene will be the same.
The export will create a table I’ll use back to draw the game level. This is the same table I use here to save a scene and load it again to edit the level.
The tool is easy to build, and just have to contain the actions I’ll have to use myself. So to keep it simple :
- At the top it’s a list of all Tiles : the Tile selector. I use TexturePacker to gather the tiles in a sheet, then load them with Corona.
- Just under I put some buttons to improve the edition :
- Arrows to move the scene,
- Arrows to move the Tile selector,
- Button to delete a Tile,
- Button to gather tiles together (and act like a big unique tile)
- On the top right : load and save buttons.
The main idea is to export the coordinates and groups as JSON to load them back either here or in the game.