SPUDevelopers / Naturalize

A Cocos2d-x turn based strategy game.
Other
11 stars 7 forks source link

Add map tile manager #7

Closed Isaac-W closed 9 years ago

Isaac-W commented 9 years ago

This should be a class that holds instances of Tile objects, in an array or dictionary object, so that we can reference different tile types to determine the stats for each tile.

Our map/level files should have a unique ID or tag associated with each type of tile. This should correspond to the particular tile instance in the manager. Basically, we should be able to grab a particular tile from the map, and request the tile stats from the manager.

Tiled supports custom properties for individual tiles, tilesets, and maps. There should be a "Name" property for every tile in a tileset, and every tileset should have a "Definition" property that specifies the tile definition/stats file. The Tile Manager should get a pointer to the TMX object, read in the Definition property, and then load the MapTiles from that Definition file. Then, Units and other game elements can reference tiles by name through the Tile Manager.

Tile definitions should be stored in an XML format, and can be read in Cocos2d-x using the included tinyxml2 library.

Isaac-W commented 9 years ago

This is dependent on the completion of issue #19.