-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathREADME
52 lines (30 loc) · 1.14 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
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