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.
polygon terrain editor
polygon terrain editor
- Attachments
-
- Polygonizer.love
- (129.63 KiB) Downloaded 93 times
Re: polygon terrain editor
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 .
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 .
Who is online
Users browsing this forum: No registered users and 188 guests