tmx 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,14 +1,43 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
- <map version="1.0" orientation="orthogonal" width="16" height="12" tilewidth="50" tileheight="50">
2
+ <map version="1.0" orientation="orthogonal" width="16" height="12" tilewidth="32" tileheight="32">
3
3
  <properties>
4
4
  <property name="hero.position" value="400,525,1"/>
5
5
  </properties>
6
- <tileset firstgid="1" name="tiles" tilewidth="50" tileheight="50">
7
- <image source="tiles.png" width="200" height="250"/>
6
+ <tileset firstgid="1" name="tiles" tilewidth="32" tileheight="32" spacing="2" margin="2">
7
+ <properties>
8
+ <property name="alpha" value="1"/>
9
+ </properties>
10
+ <image source="tiles.png" width="640" height="400"/>
8
11
  </tileset>
9
- <layer name="Tile Layer 1" width="16" height="12">
10
- <data encoding="base64" compression="gzip">
11
- H4sIAAAAAAAAA83Q3QrAIAiAUVn732pr7/+wM1AQmWJ3uzjQRV9oCQDShwFNZDHueFo/kj/0D9pI7ewvVOg8B+eRveT1PGNV/Y6yOB9GW8T7ev8brUbr7Rv9f2vfaM/zsdzZn4p8z9q5eQG5p3jRAAMAAA==
12
+ <layer name="Layer" width="16" height="12">
13
+ <data encoding="base64" compression="zlib">
14
+ eJxjYKAc9AJxHxXMwWWuCB3skwFiWSCWwyEvCcRSQCyNQ14PiPWB2ACHvDYQ6wCxLh43OCKxOZCwOFQsAEp3AnEXFv3BWMSMkNgw/fuB+ACUzUghVqUjFobSamji6Hx09fgwAPQOECE=
12
15
  </data>
13
16
  </layer>
17
+ <objectgroup name="Objects" width="16" height="12">
18
+ <object name="ground" type="floor" x="0" y="256" width="512" height="32">
19
+ <properties>
20
+ <property name="type" value="sand"/>
21
+ </properties>
22
+ </object>
23
+ <object name="platform" type="floor" x="192" y="192" width="96" height="32"/>
24
+ <object name="mushroom" type="mushroom" x="256" y="224" width="32" height="32">
25
+ <properties>
26
+ <property name="player.life.bonus" value="1"/>
27
+ </properties>
28
+ <ellipse/>
29
+ </object>
30
+ <object name="danger" type="sign" x="448" y="192">
31
+ <polygon points="0,0 32,64 -32,64 0,0"/>
32
+ </object>
33
+ <object name="dirt" type="underground" x="32" y="320">
34
+ <properties>
35
+ <property name="bones" value="2"/>
36
+ <property name="treasures" value="2"/>
37
+ <property name="type" value="dirt"/>
38
+ </properties>
39
+ <polyline points="0,0 448,0 448,64 0,64 0,0"/>
40
+ </object>
41
+ </objectgroup>
42
+ <imagelayer name="Image Layer" width="16" height="12"/>
14
43
  </map>
@@ -1,14 +1,43 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
- <map version="1.0" orientation="orthogonal" width="16" height="12" tilewidth="50" tileheight="50">
2
+ <map version="1.0" orientation="orthogonal" width="16" height="12" tilewidth="32" tileheight="32">
3
3
  <properties>
4
4
  <property name="hero.position" value="400,525,1"/>
5
5
  </properties>
6
- <tileset firstgid="1" name="tiles" tilewidth="50" tileheight="50">
7
- <image source="tiles.png" width="200" height="250"/>
6
+ <tileset firstgid="1" name="tiles" tilewidth="32" tileheight="32" spacing="2" margin="2">
7
+ <properties>
8
+ <property name="alpha" value="1"/>
9
+ </properties>
10
+ <image source="tiles.png" width="640" height="400"/>
8
11
  </tileset>
9
- <layer name="Tile Layer 1" width="16" height="12">
10
- <data encoding="base64">
11
- AwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAgAAAAUAAAAFAAAABwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAIAAAAEAAAABAAAAAcAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAACAAAABAAAAAQAAAAHAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAgAAAAQAAAAEAAAABwAAABIAAAAJAAAACQAAABEAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAIAAAAEAAAABAAAAA8AAAAOAAAABAAAAAYAAAAHAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAACAAAABAAAAAQAAAAEAAAABAAAAAQAAAAGAAAABwAAAAMAAAADAAAAAwAAAAMAAAADAAAAEgAAAAkAAAARAAAAAgAAAAQAAAAEAAAACgAAAA0AAAAEAAAACgAAAAsAAAADAAAAAwAAAAMAAAADAAAAEgAAAA4AAAAGAAAABwAAAAIAAAAEAAAABAAAAAcAAAAQAAAACAAAAAsAAAADAAAAAwAAAAMAAAADAAAAAwAAAAIAAAAEAAAABAAAAA8AAAAOAAAABAAAAAQAAAAHAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAACAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAEAAAAAgAAAAIAAAACAAAAA0AAAAEAAAABAAAAAcAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAwAAAAMAAAADAAAAAwAAAAQAAAACAAAAAgAAAALAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAA
12
+ <layer name="Layer" width="16" height="12">
13
+ <data encoding="base64" compression="zlib">
14
+ eJxjYKAc9AJxHxXMwWWuCB3skwFiWSCWwyEvCcRSQCyNQ14PiPWB2ACHvDYQ6wCxLh43OCKxOZCwOFQsAEp3AnEXFv3BWMSMkNgw/fuB+ACUzUghVqUjFobSamji6Hx09fgwAPQOECE=
12
15
  </data>
13
16
  </layer>
17
+ <objectgroup name="Objects" width="16" height="12">
18
+ <object name="ground" type="floor" x="0" y="256" width="512" height="32">
19
+ <properties>
20
+ <property name="type" value="sand"/>
21
+ </properties>
22
+ </object>
23
+ <object name="platform" type="floor" x="192" y="192" width="96" height="32"/>
24
+ <object name="mushroom" type="mushroom" x="256" y="224" width="32" height="32">
25
+ <properties>
26
+ <property name="player.life.bonus" value="1"/>
27
+ </properties>
28
+ <ellipse/>
29
+ </object>
30
+ <object name="danger" type="sign" x="448" y="192">
31
+ <polygon points="0,0 32,64 -32,64 0,0"/>
32
+ </object>
33
+ <object name="dirt" type="underground" x="32" y="320">
34
+ <properties>
35
+ <property name="bones" value="2"/>
36
+ <property name="treasures" value="2"/>
37
+ <property name="type" value="dirt"/>
38
+ </properties>
39
+ <polyline points="0,0 448,0 448,64 0,64 0,0"/>
40
+ </object>
41
+ </objectgroup>
42
+ <imagelayer name="Image Layer" width="16" height="12"/>
14
43
  </map>
@@ -1,205 +1,43 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
- <map version="1.0" orientation="orthogonal" width="16" height="12" tilewidth="50" tileheight="50">
2
+ <map version="1.0" orientation="orthogonal" width="16" height="12" tilewidth="32" tileheight="32">
3
3
  <properties>
4
4
  <property name="hero.position" value="400,525,1"/>
5
5
  </properties>
6
- <tileset firstgid="1" name="tiles" tilewidth="50" tileheight="50">
7
- <image source="tiles.png" width="200" height="250"/>
6
+ <tileset firstgid="1" name="tiles" tilewidth="32" tileheight="32" spacing="2" margin="2">
7
+ <properties>
8
+ <property name="alpha" value="1"/>
9
+ </properties>
10
+ <image source="tiles.png" width="640" height="400"/>
8
11
  </tileset>
9
- <layer name="Tile Layer 1" width="16" height="12">
10
- <data>
11
- <tile gid="3"/>
12
- <tile gid="3"/>
13
- <tile gid="3"/>
14
- <tile gid="3"/>
15
- <tile gid="3"/>
16
- <tile gid="3"/>
17
- <tile gid="2"/>
18
- <tile gid="5"/>
19
- <tile gid="5"/>
20
- <tile gid="7"/>
21
- <tile gid="3"/>
22
- <tile gid="3"/>
23
- <tile gid="3"/>
24
- <tile gid="3"/>
25
- <tile gid="3"/>
26
- <tile gid="3"/>
27
- <tile gid="3"/>
28
- <tile gid="3"/>
29
- <tile gid="3"/>
30
- <tile gid="3"/>
31
- <tile gid="3"/>
32
- <tile gid="3"/>
33
- <tile gid="2"/>
34
- <tile gid="4"/>
35
- <tile gid="4"/>
36
- <tile gid="7"/>
37
- <tile gid="3"/>
38
- <tile gid="3"/>
39
- <tile gid="3"/>
40
- <tile gid="3"/>
41
- <tile gid="3"/>
42
- <tile gid="3"/>
43
- <tile gid="3"/>
44
- <tile gid="3"/>
45
- <tile gid="3"/>
46
- <tile gid="3"/>
47
- <tile gid="3"/>
48
- <tile gid="3"/>
49
- <tile gid="2"/>
50
- <tile gid="4"/>
51
- <tile gid="4"/>
52
- <tile gid="7"/>
53
- <tile gid="3"/>
54
- <tile gid="3"/>
55
- <tile gid="3"/>
56
- <tile gid="3"/>
57
- <tile gid="3"/>
58
- <tile gid="3"/>
59
- <tile gid="3"/>
60
- <tile gid="3"/>
61
- <tile gid="3"/>
62
- <tile gid="3"/>
63
- <tile gid="3"/>
64
- <tile gid="3"/>
65
- <tile gid="2"/>
66
- <tile gid="4"/>
67
- <tile gid="4"/>
68
- <tile gid="7"/>
69
- <tile gid="18"/>
70
- <tile gid="9"/>
71
- <tile gid="9"/>
72
- <tile gid="17"/>
73
- <tile gid="3"/>
74
- <tile gid="3"/>
75
- <tile gid="3"/>
76
- <tile gid="3"/>
77
- <tile gid="3"/>
78
- <tile gid="3"/>
79
- <tile gid="3"/>
80
- <tile gid="3"/>
81
- <tile gid="2"/>
82
- <tile gid="4"/>
83
- <tile gid="4"/>
84
- <tile gid="15"/>
85
- <tile gid="14"/>
86
- <tile gid="4"/>
87
- <tile gid="6"/>
88
- <tile gid="7"/>
89
- <tile gid="3"/>
90
- <tile gid="3"/>
91
- <tile gid="3"/>
92
- <tile gid="3"/>
93
- <tile gid="3"/>
94
- <tile gid="3"/>
95
- <tile gid="3"/>
96
- <tile gid="3"/>
97
- <tile gid="2"/>
98
- <tile gid="4"/>
99
- <tile gid="4"/>
100
- <tile gid="4"/>
101
- <tile gid="4"/>
102
- <tile gid="4"/>
103
- <tile gid="6"/>
104
- <tile gid="7"/>
105
- <tile gid="3"/>
106
- <tile gid="3"/>
107
- <tile gid="3"/>
108
- <tile gid="3"/>
109
- <tile gid="3"/>
110
- <tile gid="18"/>
111
- <tile gid="9"/>
112
- <tile gid="17"/>
113
- <tile gid="2"/>
114
- <tile gid="4"/>
115
- <tile gid="4"/>
116
- <tile gid="10"/>
117
- <tile gid="13"/>
118
- <tile gid="4"/>
119
- <tile gid="10"/>
120
- <tile gid="11"/>
121
- <tile gid="3"/>
122
- <tile gid="3"/>
123
- <tile gid="3"/>
124
- <tile gid="3"/>
125
- <tile gid="18"/>
126
- <tile gid="14"/>
127
- <tile gid="6"/>
128
- <tile gid="7"/>
129
- <tile gid="2"/>
130
- <tile gid="4"/>
131
- <tile gid="4"/>
132
- <tile gid="7"/>
133
- <tile gid="16"/>
134
- <tile gid="8"/>
135
- <tile gid="11"/>
136
- <tile gid="3"/>
137
- <tile gid="3"/>
138
- <tile gid="3"/>
139
- <tile gid="3"/>
140
- <tile gid="3"/>
141
- <tile gid="2"/>
142
- <tile gid="4"/>
143
- <tile gid="4"/>
144
- <tile gid="15"/>
145
- <tile gid="14"/>
146
- <tile gid="4"/>
147
- <tile gid="4"/>
148
- <tile gid="7"/>
149
- <tile gid="3"/>
150
- <tile gid="3"/>
151
- <tile gid="3"/>
152
- <tile gid="3"/>
153
- <tile gid="3"/>
154
- <tile gid="3"/>
155
- <tile gid="3"/>
156
- <tile gid="3"/>
157
- <tile gid="2"/>
158
- <tile gid="4"/>
159
- <tile gid="4"/>
160
- <tile gid="4"/>
161
- <tile gid="4"/>
162
- <tile gid="4"/>
163
- <tile gid="4"/>
164
- <tile gid="7"/>
165
- <tile gid="3"/>
166
- <tile gid="3"/>
167
- <tile gid="3"/>
168
- <tile gid="3"/>
169
- <tile gid="3"/>
170
- <tile gid="3"/>
171
- <tile gid="3"/>
172
- <tile gid="3"/>
173
- <tile gid="16"/>
174
- <tile gid="8"/>
175
- <tile gid="8"/>
176
- <tile gid="8"/>
177
- <tile gid="13"/>
178
- <tile gid="4"/>
179
- <tile gid="4"/>
180
- <tile gid="7"/>
181
- <tile gid="3"/>
182
- <tile gid="3"/>
183
- <tile gid="3"/>
184
- <tile gid="3"/>
185
- <tile gid="3"/>
186
- <tile gid="3"/>
187
- <tile gid="3"/>
188
- <tile gid="3"/>
189
- <tile gid="12"/>
190
- <tile gid="12"/>
191
- <tile gid="12"/>
192
- <tile gid="12"/>
193
- <tile gid="16"/>
194
- <tile gid="8"/>
195
- <tile gid="8"/>
196
- <tile gid="11"/>
197
- <tile gid="3"/>
198
- <tile gid="3"/>
199
- <tile gid="3"/>
200
- <tile gid="3"/>
201
- <tile gid="3"/>
202
- <tile gid="3"/>
12
+ <layer name="Layer" width="16" height="12">
13
+ <data encoding="base64" compression="zlib">
14
+ eJxjYKAc9AJxHxXMwWWuCB3skwFiWSCWwyEvCcRSQCyNQ14PiPWB2ACHvDYQ6wCxLh43OCKxOZCwOFQsAEp3AnEXFv3BWMSMkNgw/fuB+ACUzUghVqUjFobSamji6Hx09fgwAPQOECE=
203
15
  </data>
204
16
  </layer>
17
+ <objectgroup name="Objects" width="16" height="12">
18
+ <object name="ground" type="floor" x="0" y="256" width="512" height="32">
19
+ <properties>
20
+ <property name="type" value="sand"/>
21
+ </properties>
22
+ </object>
23
+ <object name="platform" type="floor" x="192" y="192" width="96" height="32"/>
24
+ <object name="mushroom" type="mushroom" x="256" y="224" width="32" height="32">
25
+ <properties>
26
+ <property name="player.life.bonus" value="1"/>
27
+ </properties>
28
+ <ellipse/>
29
+ </object>
30
+ <object name="danger" type="sign" x="448" y="192">
31
+ <polygon points="0,0 32,64 -32,64 0,0"/>
32
+ </object>
33
+ <object name="dirt" type="underground" x="32" y="320">
34
+ <properties>
35
+ <property name="bones" value="2"/>
36
+ <property name="treasures" value="2"/>
37
+ <property name="type" value="dirt"/>
38
+ </properties>
39
+ <polyline points="0,0 448,0 448,64 0,64 0,0"/>
40
+ </object>
41
+ </objectgroup>
42
+ <imagelayer name="Image Layer" width="16" height="12"/>
205
43
  </map>
@@ -1,17 +1,43 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
- <map version="1.0" orientation="orthogonal" width="16" height="12" tilewidth="50" tileheight="50">
2
+ <map version="1.0" orientation="orthogonal" width="16" height="12" tilewidth="32" tileheight="32">
3
3
  <properties>
4
4
  <property name="hero.position" value="400,525,1"/>
5
5
  </properties>
6
- <tileset firstgid="1" name="tiles" tilewidth="50" tileheight="50">
6
+ <tileset firstgid="1" name="tiles" tilewidth="32" tileheight="32" spacing="2" margin="2">
7
7
  <properties>
8
8
  <property name="alpha" value="1"/>
9
9
  </properties>
10
- <image source="tiles.png" width="200" height="250"/>
10
+ <image source="tiles.png" width="640" height="400"/>
11
11
  </tileset>
12
- <layer name="Tile Layer 1" width="16" height="12">
12
+ <layer name="Layer" width="16" height="12">
13
13
  <data encoding="base64" compression="zlib">
14
- eJzN0N0KwCAIgFFZ+99qa+//sDNQEJlid7s40EVfaAkA0ocBTWQx7nhaP5I/9A/aSO3sL1ToPAfnkb3k9TxjVf2OsjgfRlvE+3r/G61G6+0b/X9r32jP87Hc2Z+KfM/auXkBKFMDxg==
14
+ eJxjYKAc9AJxHxXMwWWuCB3skwFiWSCWwyEvCcRSQCyNQ14PiPWB2ACHvDYQ6wCxLh43OCKxOZCwOFQsAEp3AnEXFv3BWMSMkNgw/fuB+ACUzUghVqUjFobSamji6Hx09fgwAPQOECE=
15
15
  </data>
16
16
  </layer>
17
+ <objectgroup name="Objects" width="16" height="12">
18
+ <object name="ground" type="floor" x="0" y="256" width="512" height="32">
19
+ <properties>
20
+ <property name="type" value="sand"/>
21
+ </properties>
22
+ </object>
23
+ <object name="platform" type="floor" x="192" y="192" width="96" height="32"/>
24
+ <object name="mushroom" type="mushroom" x="256" y="224" width="32" height="32">
25
+ <properties>
26
+ <property name="player.life.bonus" value="1"/>
27
+ </properties>
28
+ <ellipse/>
29
+ </object>
30
+ <object name="danger" type="sign" x="448" y="192">
31
+ <polygon points="0,0 32,64 -32,64 0,0"/>
32
+ </object>
33
+ <object name="dirt" type="underground" x="32" y="320">
34
+ <properties>
35
+ <property name="bones" value="2"/>
36
+ <property name="treasures" value="2"/>
37
+ <property name="type" value="dirt"/>
38
+ </properties>
39
+ <polyline points="0,0 448,0 448,64 0,64 0,0"/>
40
+ </object>
41
+ </objectgroup>
42
+ <imagelayer name="Image Layer" width="16" height="12"/>
17
43
  </map>
Binary file
@@ -18,6 +18,6 @@ Gem::Specification.new do |gem|
18
18
 
19
19
  gem.files = `git ls-files`.split($/)
20
20
  gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
21
- gem.test_files = gem.files.grep(%r{^(spec)/})
21
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
22
22
  gem.require_paths = ["lib"]
23
23
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tmx
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shawn Anderson
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-04-02 00:00:00.000000000 Z
12
+ date: 2013-04-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: oj
@@ -52,9 +52,13 @@ files:
52
52
  - Guardfile
53
53
  - LICENSE.txt
54
54
  - README.md
55
+ - Rakefile
55
56
  - lib/tmx.rb
57
+ - lib/tmx/image_layer.rb
56
58
  - lib/tmx/layer.rb
57
59
  - lib/tmx/map.rb
60
+ - lib/tmx/object.rb
61
+ - lib/tmx/object_group.rb
58
62
  - lib/tmx/parsers/json.rb
59
63
  - lib/tmx/parsers/parsers.rb
60
64
  - lib/tmx/parsers/tmx.rb
@@ -62,13 +66,16 @@ files:
62
66
  - lib/tmx/tile_set.rb
63
67
  - lib/tmx/version.rb
64
68
  - spec/features/json_format_spec.rb
69
+ - spec/features/json_isometric_format_spec.rb
65
70
  - spec/features/xml_format_spec.rb
71
+ - spec/fixtures/map-isometric.json
66
72
  - spec/fixtures/map.json
67
73
  - spec/fixtures/map_csv.tmx
68
74
  - spec/fixtures/map_gzip.tmx
69
75
  - spec/fixtures/map_uncompressed.tmx
70
76
  - spec/fixtures/map_xml.tmx
71
77
  - spec/fixtures/map_zlib.tmx
78
+ - spec/fixtures/tiles.png
72
79
  - spec/spec_helper.rb
73
80
  - tmx.gemspec
74
81
  homepage: https://github.com/shawn42/tmx
@@ -97,11 +104,14 @@ specification_version: 4
97
104
  summary: A library for parsing the Tiled Map Editor file format.
98
105
  test_files:
99
106
  - spec/features/json_format_spec.rb
107
+ - spec/features/json_isometric_format_spec.rb
100
108
  - spec/features/xml_format_spec.rb
109
+ - spec/fixtures/map-isometric.json
101
110
  - spec/fixtures/map.json
102
111
  - spec/fixtures/map_csv.tmx
103
112
  - spec/fixtures/map_gzip.tmx
104
113
  - spec/fixtures/map_uncompressed.tmx
105
114
  - spec/fixtures/map_xml.tmx
106
115
  - spec/fixtures/map_zlib.tmx
116
+ - spec/fixtures/tiles.png
107
117
  - spec/spec_helper.rb