Issue 197 in los-cocos: platformer-map.xml uses inconsistent type for collision properties

1 view
Skip to first unread message

codesite...@google.com

unread,
Aug 8, 2013, 2:27:29 PM8/8/13
to cocos-...@googlegroups.com
Status: Accepted
Owner: ccan...@gmail.com

New issue 197 by ccan...@gmail.com: platformer-map.xml uses inconsistent
type for collision properties
http://code.google.com/p/los-cocos/issues/detail?id=197

tiles.RectMapCollider.do_collision docstring specifies

The RectCell must have the boolean properties "top", "left",
"bottom" and "right" for those sides which the rect should collide.

tiles.RectCell docstrings tells

The cell may have the standard properties "top", "left", "bottom" and
"right" which are booleans indicating that those sides are impassable.
These are used by RectCellCollider.

The code is consistent with collision properties being booleans, but:

- The example platformer-map.xml specifies them in the style
<tile id="b1"><image ref="i-b1" />
<property name="top" value="yes" />
</tile>

- Theres no special conversion at load

- So the properties end being strings.

The correct way to specify the collision props is using type="bool" and
value="True" (or "False") , like in
<tile id="b1"><image ref="i-b1" />
<property name="top" type="bool" value="True" />
</tile>

Attached a script to dump properties for maps loaded with the xml loader.
Does all layers and marks which properties appear by way of
cell.tiles.properties

Attachments:
test_RectMapLayer_dump_cell_properties.py 1.2 KB

--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

codesite...@google.com

unread,
Aug 8, 2013, 2:34:55 PM8/8/13
to cocos-...@googlegroups.com
Updates:
Status: TrunkFixed

Comment #1 on issue 197 by ccan...@gmail.com: platformer-map.xml uses
inconsistent type for collision properties
http://code.google.com/p/los-cocos/issues/detail?id=197

fix committed at r1238

codesite...@google.com

unread,
Aug 8, 2013, 2:37:38 PM8/8/13
to cocos-...@googlegroups.com
Updates:
Labels: Type-Defect Component-Tiles

Comment #2 on issue 197 by ccan...@gmail.com: platformer-map.xml uses
inconsistent type for collision properties
http://code.google.com/p/los-cocos/issues/detail?id=197

(No comment was entered for this change.)
Reply all
Reply to author
Forward
0 new messages