Allegro.cc - Online Community

Allegro.cc Forums » Allegro Development » Allegro-Tiled: adding Tiled map support to Allegro 5

This thread is locked; no one can reply to it. rss feed Print
Allegro-Tiled: adding Tiled map support to Allegro 5
Damien Radtke
Member #14,259
April 2012

This is a project I started a little while back which is finally approaching a point of what can loosely be called usability. The goal is to create a reusable Allegro library for loading and displaying tile-based maps stored in Tiled's TMX format.

Link.

The provided Makefiles currently only support Linux, but the source should work for other platforms as well.

Drawing and loading a map is as simple as a few lines of code:

map_data *map = parse_map("data/maps", "level1.tmx");
al_clear_to_color(al_map_rgb(0, 0, 0));
draw_map(map);
al_flip_display();

If you run the example provided in the project source, you can scroll around the map with the arrow keys and reload any changes made to level1.tmx by pressing Space.

Highest up on my to-do list are properly releasing memory after it's no longer needed and picking a naming scheme consistent with other Allegro libraries.

Feedback and suggestions are welcome. 8-)

Go to: