Pix2Level - Create Levels From Pixel Art

Show off your games, demos and other (playable) creations.
Post Reply
User avatar
Baggef
Prole
Posts: 20
Joined: Fri Aug 23, 2019 7:30 pm
Location: USA
Contact:

Pix2Level - Create Levels From Pixel Art

Post by Baggef »

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.
Image

Feel free to reuse the code any way you want!
Attachments
paintLevel.love
(11.49 KiB) Downloaded 335 times
gaeem defelpmint is maiy pashin
Itch: Freakman
User avatar
ivan
Party member
Posts: 1911
Joined: Fri Mar 07, 2008 1:39 pm
Contact:

Re: Pix2Level - Create Levels From Pixel Art

Post by ivan »

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.
User avatar
Murii
Party member
Posts: 216
Joined: Fri Jul 05, 2013 9:58 am
Location: Arad, Romania
Contact:

Re: Pix2Level - Create Levels From Pixel Art

Post by Murii »

How do you want to handle multiple layers a map can have? Eg: a layer used just for the background.
User avatar
ivan
Party member
Posts: 1911
Joined: Fri Mar 07, 2008 1:39 pm
Contact:

Re: Pix2Level - Create Levels From Pixel Art

Post by ivan »

Murii wrote: Tue Dec 24, 2019 9:19 pm How do you want to handle multiple layers a map can have? Eg: a layer used just for the background.
There are several ways to achieve this. You could use each of the RGBA channels as a layer.
Post Reply

Who is online

Users browsing this forum: No registered users and 38 guests