Original Post
Hi, I am in the process of writting a river city ransom style of side scrolling beat em up game. I am using SDL and C++ (code::blocks ide). Currently I am working on the Sprite Manager class (singleton) and I'd like to run it by you guys to see if what I'm doing makes sense and if possible there are some other ideas that could help me along the way. The class looks something like this: It contains a private member map where the string portion holds the filename of the sprite and a pointer to an SDL_Surface. There is an interface which returns the SDL_Surface pointer when passed a sprite filename. This would be used by the map rendering process (the map would be a vector of structs containing amoung other things the filename of the sprite). Entities would have a series of filenames held in vectors for animation purposes (jumping, running, walking etc...). It also contains another map> where the first string holds the "group" that the sprites following belong to. This is used for the Map Editor portion of the game. The reason I will have it organized like this is so that each "group" series of sprites to be shown in a pallet in the map editor program. The would be grouped into things like roads, grass, buildings etc... An interface would be created to return a vector with all the filenames belonging to that group. There would be an interface for loading the above two maps with data from an XML/Text file: to contain that extra information along with the SDL_Surface pointer. I am clearly a beginner to C++ and some of these ideas may not be that great. I have scoured the boards for information concerning Sprite Manager classes but there doesn't seem to be too much on this subject. Anyone care to expand on these ideas with me?
<group name="roads">
<sprite name="gray_road_1.png" solid="0">
<sprite name="gray_road_2.png" solid="0">
</group>
<group name="wall">
<sprite name="stone_wall_1.png" solid="1">
<sprite name="clay_wall_1.png" solid="1">
</group>
The additional information such as "solid" would be default information for a specific tile and I would imagine this may require me to change the above maps to be map