Skip to content

eilara/Games-TMX-Parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Games::Tmx::Parser
==================

Parses TMX files from the Tiled map game editor:

http://www.mapeditor.org/

Draw your maps in Tiled, then use this module to parse and build maps and
waypoints for your game.

Provides a simple OO XML::Twig-like API for accessing every corner of the map
object model.


Usage
-----

In Tiled, draw your map and place properties as markers on special tiles you
want to read in Perl. Then in your Perl game, read the map and use:

    my @cells = $map->get_layer('layer_with_stuff')
                    ->find_cells_with_property('my_special_tile_marker');
 
To find your special cells (spawn points, enemy locations, etc.).

Draw a layer by iteating over:

    @{ $layer->rows };

Which will give you an ARRAY ref of cells, one per column. Then you can find
the tile of the cell using:

    $cell->tile;

And then access its properties, or cut the correct image from the tileset image file:

    $tile->tileset->image;


Requires
--------

- Moose
- XML::Twig


Not Implemented
---------------

- no support for base64 or compression of maps, uncheck the correct check boxes in Tiled before you save
- no support for object layers

About

Parses TMX files from the Tiled map editor

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages