polygon terrain editor

Showcase your libraries, tools and other projects that help your fellow love users.
Post Reply
Rigachupe
Citizen
Posts: 83
Joined: Fri Jun 18, 2021 11:21 am

polygon terrain editor

Post by Rigachupe »

Added small tool for creating polygon based terrain.

Polygons are triangulated and then stored as a mesh to be drawn faster. It is just a technical prototype. So feel free to play with the .love (.zip) project file.

Useable for those who are trying to make games based on physics terrain like those motobike crossroads games.
polygons.png
polygons.png (182.18 KiB) Viewed 2185 times
triangles.png
triangles.png (32.61 KiB) Viewed 2185 times
Attachments
Polygonizer.love
(129.63 KiB) Downloaded 92 times
Rigachupe
Citizen
Posts: 83
Joined: Fri Jun 18, 2021 11:21 am

Re: polygon terrain editor

Post by Rigachupe »

Also a nice way to store created levels into a file is to have only a table with values and no functions. And then write that into a lua file!

If you have a lua file you can require it or use love.filesystem.load function to import the script as whatever you need (level, definitions, texts etc...) and then no need to have json files.

To save a table into a text file you need only something that can serialize that table into a text and write it love.filesystem.write to the file in love save directory.

Then that file you can either let it there and work with it or put it into the project directory.

And i repeat again, no need to have a parser for this lua file. You only load it as a chunk by using love.filesystem.load and then you get directly the content like this.

example of such lua file:
return {
[1]="hello",
[2]="world",
}

I hope it helps even newbies who struggle to get some data back into the game.

PS: If a table serialization would exist as a love function i personally would like it even more :).
Post Reply

Who is online

Users browsing this forum: No registered users and 55 guests