Simple 2D map editor. From a tileset to a .txt .json or .lua file.
Single-layer 2D map editor using a .png tileset.
It features map resizing, drawing, erasing, filling…
Export maps to txt, json or lua format.
Built with love2d it runs on Windows, macOS and Linux.
Tileset from https://ansimuz.itch.io/grotto-escape-game-art-pack
This minimalist software does not provide any integrated tips or documentation, you should refer to this section if you need help.
$ love 2d_map_editor.love
from the command prompt).Keys | Description |
---|---|
D | Draw |
E | Erase |
F | Fill |
Alt | Tile picker |
Mouse Right | Tile picker |
←↑→↓ | Move |
Spacebar + Mouse Left | Move |
Mouse Wheel | Zoom |
A 2d map is encoded as a 2d array of numbers. Each number matches a tile from the tileset.
Considering the following tileset:
And this 2d array of number:
{
{19, 19, 1, 4, 19},
{21, 19, 9, 19, 19},
{19, 19, 19, 19, 19},
{16, 16, 6, 15, 16},
{13, 13, 13, 13, 13}
}
We get the following map:
If your using the lua programming language, just require the map in your project:
local map = require("path/to/my/map")
Create/find a parser for the file format you want your map to be in.
Builds are done using the “Release” script that itself uses boon.
Running ./Release
will create a folder named “release”, using ./Release -z
will zip the folders contained in the release folder.
The project is currently finished, however feel free to open an issue if you encounter one. No features will be added.
Initialy I wanted to be able to create maps for my 2d games, I tried tiled but it’s a big editor with tons of features and it was exporting maps in the json format, so I should have learned how to use the editor and use a library to parse json files.
Since I only needed single layers maps I started this little project.
It was one of my first desktop application so it was very interesting on many points.
I created the map editor 2+ years ago but I never finished some features/polish but used it in multiple projects like It Alive. It’s why I came back on it with the desire to make the initial idea come true.
I find the project/code structure really bad now and that’s a good thing, it means that my programming practices/skills have improved since.
If I had to do it again now, I would do it in a much different maner.
Thanks for reading.