Mappy tile mapping system now available for Allegro 5
Neil Walker

Hello,
I've been beavering away and have an Allegro 5 version of mappy tilemap system (http://www.tilemap.co.uk/mappy.php) and would appreciate your perusal. I've been using mappy for a long time and I think it's really really good and more people should use it :)

Features:
- standard square tilemap
- hex based tiles
- staggered isometric maps
- parallax scrolling
- embedded graphics
- embedded animations
- supports 8, 15,16,24,32 bit map files
- 8 layers, each layer comprising 1 background and 3 foreground tiles for extra layering
- each tile can have many custom variables associated
- extendible through your own data chunks in the file
- simple interface for use
- complete editor for tilemaps with onion skinning, lua support (for scripting such as auto smoothing, GBA support), etc (this is for windows only, but works fine under wine)
- I use the allegro file handlers so should work with physfs
- conversion of pink/black/index 0 to alpha if required

Demo:
- demo includes a mix of 8 and 32 bit maps in standard, hex and iso format with animated tiles and parallax. Sorry, the scrolling is a bit pants with regard smoothness, that's just my coding :)

Instructions:
- readme containing functions
- html documentation describing how mappy works and how to use it plus the file format, etc

Screenshots:
{"name":"603872","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/6\/4\/645a91eb9424855338840758a78661d3.jpg","w":656,"h":518,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/6\/4\/645a91eb9424855338840758a78661d3"}603872
{"name":"603874","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/e\/f\/efecdf8c0a8194e3a5487fd1c5835abb.jpg","w":656,"h":518,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/e\/f\/efecdf8c0a8194e3a5487fd1c5835abb"}603874
{"name":"603873","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/7\/8\/78ecb1421ed30c86265b2033248e8642.jpg","w":656,"h":518,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/7\/8\/78ecb1421ed30c86265b2033248e8642"}603873
{"name":"603876","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/5\/7\/572c5f5608206827bfaa0f20a34c8fd3.jpg","w":642,"h":511,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/5\/7\/572c5f5608206827bfaa0f20a34c8fd3"}603876

Compiling:
1. Add the mappy_a5.c to your project
2. Add the mappy_a5.h to your project
3. Include the header in your game and compile. Note, the file must be compiled as C not C++

The demo was compiled using the allegro-5.0.2-monolith-md library and visual studio 2010 so you will need this dll handy and I don't know about the effects of a visual studio exe is on non-msvc systems.

Get it from the mappy.zip attachment.

Quick Usage:
Essentially, read the demo1.c, it's self-explanatory.

1. Load the map using MapLoad() passing in the file and whether you want black/pink/index 0 converting to alpha channel
2. Use MapFreeMem() when finished
3. Use MapDrawBG() to draw background and MapDrawFG() to draw foreground tile layers
4. Use MapUpdateAnims() to update animations
5. Various helper functions to get/set tiles, etc.

This is first version so there may be issues :)

Edgar Reynaldo

3. Include the header in your game and compile. Note, the file must be compiled as C not C++

If the code in the header is defined as "extern C" there shouldn't be a problem compiling as C++, right? Or is it something else?

Neil Walker

Yes, it is, but I think it's more to do with the exotic use of void pointers and non-casting :)

But it's not an issue really, if you are coding in C++, in MSVC it works by file extension (but you can just tell it to compile that file as c and mix c/c++ files), and in mingw editors you probably need to compile the .c to a .o and use that instead first.

Thread #606962. Printed from Allegro.cc