Hello,I haven't got much experience in game programming and especially in 2D platformers. I am wondering how do you make such maps because I can see them as one long spritesheet but this does not seem to me quite right as I cant see people making such long maps in one spritesheet. Another way I could imagine is split it into smaller images which joined together one after another would make up whole map or another way is generating the enviroment on the run but this would be quite difficult.

You can make these images in something simple like MS Paint or GIMP or Paint.NET. For example, a floor tile could be represented as a white pixel, while a wall tile could be a black pixel. A health pickup could be red, an enemy could be green, and so on. You can load this image into your game and have the computer make an array of ints, where you then say, "Okay, if this pixel here is white, put a floor tile in the game world at these coordinates. If it's black, make a wall" and so on.

What's nice about this is that you can pretty easily edit levels on the fly by just opening up the paint program.

Here's a method I made for one of my games to get the int[][] of colors out of the original image:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22

//this is what's supposed to load the RGB values from the .png into my map[][] arraypublicint[][] loadRGBMap(Stringdirectory){ int[][] map;

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org