|
libgamemaps
|
libgamemaps provides a standard interface to access different game levels regardless of their file format.
The main interface to the library is the getManager() function, which returns an instance of the Manager class. The Manager is used to query supported map formats, and for each supported file format it returns an instance of the MapType class.
The MapType class can be used to examine files and check what file format they are in, and if they are in the correct format, to open them. Successfully opening a map produces an instance of the Map class. The MapType class can also be used to create new maps from scratch, which will again return a Map instance.
The Map class is used to directly manipulate map files, changing the level as it appears in-game. The Map class itself is a base class, and is extended in the form of the Map2D class for editing maps from platform-style games. There are currently no plans to implement a Map3D class (e.g. for Build games) however should someone be dedicated enough the library can support this.
The libgamemaps distribution comes with example code in the form of the gamemap utility, which provides a simple command-line interface to the full functionality of the library.
For a small "hello world" example, try this:
When run, this program produces output similar to the following:
This map has 2 layers.
Additional information including a mailing list is available from the Camoto homepage http://www.shikadi.net/camoto.
1.8.3.1