Sunday, January 9, 2011

Your recommendation for path construction from a single background image?

So I currently have my background as a single PNG and some obstacles (like blocks as part of that PNG). In order to create a path, I currently store pixels above a unique green color (my hill) and use this to move the character. My question is, is it better to create something like a collision layer mask or somehow convert my PNG to a bunch of tiles? Is this possible?

  • Yes, it is strongly suggested that you move to a data driven map, with layers and tiles. It will make your life easier, your maps will be editable in other tools(like map editors). You could even think of randomly generating maps and much much more!

    Happy coding!

    Ilya : Is there any tool that you personally recommend (there are tons of these programs out there). Will I have to start from scratch or can these map editors load a png and then I can just define where my tiles will be?
    Cyclops : @Ilya, Tiled, which @Christopher recommended, does just that, takes a bitmap and uses it for tiles. Give it a try, it's a nice program.
    From DFectuoso
  • Two programs you should at least take a look at are Mappy and Tiled. A library for XNA integration with Tiled called TiledLib has been developed and could be of some use, if only to take a look at for ideas.

  • In Stendhal we use several layers of a map: ground, floor, objects, roof, roof_2. This way it is easy to create new maps based on images already created. We use two additional layers that only contain a green or red square called collision and protections.

    You may get some ideas from our map tutorial. The map editor "Tiled" is from http://www.mapeditor.org/

    From nhnb

0 comments:

Post a Comment