Level Editor for generic Tower Defense

Showcase your libraries, tools and other projects that help your fellow love users.
Post Reply
nyenye
Citizen
Posts: 62
Joined: Fri Dec 02, 2016 1:44 pm

Level Editor for generic Tower Defense

Post by nyenye »

Working on a TowerDefense kind of game and didn't want to use Tiled as a level editor, so I've made this little thing.

What does it do:
  • Load an image to set as background. (/res/test.png in the example).
  • Change number of waves for the Level.
  • Switch between three main tools (GOAL, BUILDING, SPAWN). Each of them, represents a common thing in a classic TowerDefense:
    • GOAL: Point that enemies try to reach. Can be more than one.
    • BUILDING: More specific would be building point, and it represents a spot where the user can build a tower.
    • SPAWN: Again, represents a spawn point. Where enemies will come from.
  • Can create new entities with the main click.
  • Can drag and drop created entities, to reposition them on the map.
  • Can remove entities with the second click.
  • When selecting a SPAWN entity, a menu is shown, where you can add, edit, and remove enemies for each wave.
  • A help dialog is shown at the bottom. Can be disabled by pressing H.
  • Save edited level by pressing CTRL+S
  • Restore last deleted entity by pressing CTRL+Z (only last one)
When the Level is saved, it will save at '/res/result.lua', it returns a well formatted object with everything that you set up on the editor. Then you have to take care to parse the file on the game itself.

NOTE: Right now I haven't found the way to save the file when the tool is executed as a .love file. To make it work right now, it should be executed from the terminal/cmd. Sorry for that!

Code: Select all

cd level_editor_directory
love ./
Github: https://github.com/nyenye/td-level-editor

EDIT: Updated. Just code refactoring.
Attachments
td-level-editor.love
(42.96 KiB) Downloaded 137 times
Screencast_10-17-2017_07_53_08 PM.gif
Screencast_10-17-2017_07_53_08 PM.gif (2.01 MiB) Viewed 2118 times
Post Reply

Who is online

Users browsing this forum: No registered users and 53 guests