I'm building a small platformer game with multiple levels, similar to old-school Mario, and I was wondering how devs created levels. This is my first game, so I'm pretty new to design & such. I've seen people use Paint.NET or Photoshop to create a level where certain colors in the world represent various tiles & such, that are rendered throughout the level. For instance, a red block in the world on a blue background would represent a tile that a player can jump on, and would be rendered so when the game is started. Is this an effective way of designing levels, or is there a better way? Please explain your process.
closed as primarily opinion-based by Nicol Bolas, bummzack, Anko, Byte56♦ Jul 29 '13 at 22:54
Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise.If this question can be reworded to fit the rules in the help center, please edit the question.
For such a task you create/use an level editor. In the editor you can do all sorts of things, place tiles, lace enemies, program/link/load scripts, set effects, ...
I actually don't know any standard 2d Level Editor.
Creating a Level Editor is no simple task but here are some hints how to get started:
just keep it simple so you don't waste too much time if you decide to throw it away.
I have created a level editor for a 2d top-down rpg. The principles are exactly the same for a 2d side-scroller like mario.
Here is what I did.
I created an 4 arrays of numbers. Each array represents a layer and each number in the array represents a tile. A tile is simply a square chunk of pixels. The location of the number in the array represents the location on the screen the tile should be drawn to. So with an array of size , setting  to the number 1 would draw, let's say grass, to the center of the screen.
When you create your map editor, you'll want to display all the available tiles the user can use to paint the level. When a user selects a tile in the map editor there should be some indication that the tile has been selected and the tile should have a number associated with it.
When the user clicks somewhere on the screen, you detect which area he clicked on and send the tile's number to the array responsible for the layer he's drawing on. that way you fill each array with tile numbers so that when you render the map, you only need to iterate through each array and draw the tile based on the tile number and position in the array.
You'll need to determine how large you want your levels to be. For a sidescroller you'll want a very wide 2d array, maybe something like ground for the ground layer.
To implement layers, simply draw them in order. It may be something like ground, background, player sprite, foreground foreground2. The player sprite will then draw on top of the ground and background layers and the two foreground layers will cover the sprite.