bajotech / allegro_tiled

Experimental Tiled map support for Allegro

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

allegro_tiled

allegro_tiled is an Allegro 5 module that adds support for parsing and using TMX map files. This means that Tiled, as well as any other program supporting the same map format, can be used to create and edit game worlds while the complexity of parsing and drawing them is completely taken care of:

ALLEGRO_MAP *map = al_open_map("data/maps", "level1.tmx");
al_draw_map(map, 0, 0, 0); // (map, dx, dy, flags)

Additional methods are provided to draw one map layer at a time and/or draw only a particular section. Layers, tilesets, tiles, and objects are all given types, with methods that make them easy to access and use.

screenshot

Currently, the following is supported:

  1. Orthogonal maps.
  2. Base64 encoding with gzip, zlib, or no compression.
  3. XML and CSV encoding. (though honestly, why would you?)
  4. Tile "flipped" flags, both vertically and horizontally.
  5. Objects.

The following is not yet supported:

  1. Isometric maps.

Compiling the Library

On Linux:

Make sure the following dependencies are installed:

  • allegro
  • allegro_image
  • xml2
  • zlib
  • glib

Then simply run make in the root folder to compile it, and optionally sudo make [install|uninstall] to handle (un)installation. To run the example, cd to the examples folder and type make run. Use the arrow keys to scroll and Space to reload the map file.

On Other Platorms:

No other platforms are supported yet, but this should change in the future. If you want to have this module available on your platform ASAP, then let me know!

About

Experimental Tiled map support for Allegro