I made a simple little "level editor", if you can call it that, that uses a low resolution image to create a level based on the rgb values of the pixels in the image. Currently there are ground tiles, platforms, lava, and coins. Only the coins work but this is more a proof of concept for an image level editor in love2d.
The colors are black, green, red, and yellow and any other color is ignored but still drawn.
Feel free to reuse the code any way you want!
Pix2Level - Create Levels From Pixel Art
Pix2Level - Create Levels From Pixel Art
- Attachments
-
- paintLevel.love
- (11.49 KiB) Downloaded 350 times
gaeem defelpmint is maiy pashin
Itch: Freakman
Itch: Freakman
Re: Pix2Level - Create Levels From Pixel Art
I've seen this technique used in several 2d games, where the level data is in a picture format.
Personally I have used plain txt files which makes associating characters to tiles easier.
I think you could find a better way to resolve colors to tiles, since your "get_obj(x,y,r,g,b,ind)" function will not scale very well.
Personally I have used plain txt files which makes associating characters to tiles easier.
I think you could find a better way to resolve colors to tiles, since your "get_obj(x,y,r,g,b,ind)" function will not scale very well.
Re: Pix2Level - Create Levels From Pixel Art
How do you want to handle multiple layers a map can have? Eg: a layer used just for the background.
Twitter: https://twitter.com/Murii5
Re: Pix2Level - Create Levels From Pixel Art
There are several ways to achieve this. You could use each of the RGBA channels as a layer.
Who is online
Users browsing this forum: alexjgriffith and 0 guests