This blog is no longer updated. Feel free to copy any useful information to other blogs or wikis as this site may not exist for much longer. Thanks.


Pixel Man Post Mortem #2

September 26th, 2009 | Comments Off

Much like your average programmer, whenever I start a project there is an inherent desire to reinvent every wheel possible, and then create some new wheels to invent. It’s a flaw I feel I share with lots of developers; the desire to create things you don’t really need, but think you might. The biggest one of these is always the level editor. Creating a full UI, with undo/redo, and a million little things that you think will make it the best level editor. Well this time I managed to easily convince myself not to create my own level editor, but to utilize one already out there:

Paint.NET Logo

That’s right. Paint.NET was my level editor. For such a simple game it was really quite easy. I would draw out bitmap images that used a simple color key system:

  • Grey pixels are walls
  • Red pixels are the red blocks
  • One yellow pixel for the goal
  • One green pixel for the starting point
  • Everything else is white

Super simple, but it got the job done and immediately gave me a level editor that supported drawing, erasing, undo/redo, and a bunch of other things like selections. By using Paint.NET instead of trying to create a level editor, I likely saved myself hours and hours of stupid work.

In the end my levels looked like this one:

Level 20

(Enlarged 2000%)

Now you might be thinking, “Nick, of course you can use Paint.NET because you have such a simple game. But I have all sorts of tiles and other things. Surely I can’t utilize Paint.NET for my levels.” Possibly. This is a tool that might not work. But consider these ideas for ways you can still utilize bitmap levels:

  • You have a lot of colors to work with. So if you have lots of tiles, you can create a palette of colors to represent them.
  • You an do some procedural generation type things. For instance, let’s say you have five different grass tiles for your game. In Paint.NET you could just draw a line of green pixels and then your level loading code can choose (either randomly or by some logic) which tiles exactly to use.

So there you go. Think about using Paint.NET next time you need a level editor. It might seem likeĀ a bit of work to use a color key system, but the time spent choosing those colors is likely far less than writing a custom tool by hand, not to mention all the things Paint.NET has that you’d have to create like undo/redo and the selection tool, both very handy things when making levels.

In my next post, I’ll start going into some of the code aspects of the game including the menus, level loading, and the character code. Heck, when I’m done you might just have enough code to make your own little platformer. :)


Possibly Related Posts

(Automatically Generated)
Pixel Man Post Mortem #3
Pixel Man Post Mortem #1
Pixel Man Post Mortem #5
Pixel Man Reception
Scaling retro sprites at build time

Comments are closed.