Members - Reputation: 127
Posted 17 August 2012 - 01:09 PM
Crossbones+ - Reputation: 1951
Posted 25 August 2012 - 09:20 PM
Members - Reputation: 327
Posted 28 August 2012 - 06:12 AM
I definitely wouldn't recommend loading one giant image for your map though, remember with tiled maps you can create entire worlds from just a handful of images. It takes more memory to load a really big image, than a small handful of 32x32 tiles. Servant of the Lord has a pretty good explanation of how to implement tiled maps for your game here. Writing a map editor would be the same concept, but instead of loading the map data from a file you make in a text editor, you would save out the map data to a file depending how where the tiles are that you placed. Let me know if you have any more specific questions on how to do this if you're interested, it's actually really simple pretty efficient. I did this recently for my game, here is a screenshot of it that shows what tiled maps can produce.
Taking the tiled map approach as opposed to the "saving one big image" approach, has man more advantages than just taking up less memory. With the data for each tile that your custom world editor (that you could easily write), by creating a Tile class you can store more information than just the tile's image. You can store the location on the map, the type of tile it is, weather or not it's a walkable tile (or drivable if your doing roads and such), etc. That makes collision detection a lot easier in the long run vs having to go in and hard code all the areas that you can't walk/drive.
You could easily implement a basic tile blending algorithm to make the transitions between your tiles smooth if that's what you're looking for. This is what the above screenshot would look like with an image blending algorithm for the tiles.
I understand this can be a little confusing at first, but I promise it's really not a difficult concept to implement. Let me know if you need any more specific help or have any questions!