So well now I'm gonna make another swing at it. Starting with a good map format and a decent level editor. And this is what I'm gonna describe here. If it sucks, please tell me so, so I don't spend a lot of time(that I don't have) on something worthless.
Basically I want a map format I can use for all tile based games I'm gonna make, and if it's good share with people to make their game making easier. So it have to be quite general. I don't really know how to accomplish this yet. Say if I use a SDL_Surface to store the images it is bound to SDL and so on, the best idea I've come up with is to only use graphics in one class and then if I want to use another API then just change the base class. Or if people want to use their own sprite class, they just change my sprite class with their own. But well I'm gonna make some more looking into it before I make a decision.
Anyone played and looked at SMC (Secret Maryo Chronicles)? They have a level editor thats basically like the one I want to make, you can position every tile diferent, each tile has own coordinates not tile coordinates that are multiplied with the tile width to get the position. This is how I want to make my maps. So I'm gonna make every tile a sprite, basically.
Well here comes the early sketch of my map format:
The ultimate base class, contains data everything has, mass position and velocity is the first to come to mind, perhaps some more data.
- Sprite : Entity
The sprite class, the one people change to use different API and such, provides drawing, moving, animation, collision and such.
- Image : Entity
Basically a static(non-animated) sprite.
- Tile : Entity // This may be unnecessary
A tile is either a image or a sprite.
A layer contains a list of Entities, when you add a Entity you add it to the list of the layer.
Contains a list of layers to support multiple layers. Contains map data, name background image and such.
Contains functions to save and load levels.
The Entity, Image, Sprite, Tile, Layer and Map classes are gonna be serialization able. And the map file contains a serialized Map. In binary format.
Well that is about how far I've come. Sounds good?
If you got this far: Thanks for reading [smile]!