google-code-export / los-cocos

Automatically exported from code.google.com/p/los-cocos
Other
1 stars 0 forks source link

platformer-map.xml uses inconsistent type for collision properties #197

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
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

Original issue reported on code.google.com by ccanepacc@gmail.com on 8 Aug 2013 at 6:27

Attachments:

GoogleCodeExporter commented 9 years ago
fix committed at r1238

Original comment by ccanepacc@gmail.com on 8 Aug 2013 at 6:34

GoogleCodeExporter commented 9 years ago

Original comment by ccanepacc@gmail.com on 8 Aug 2013 at 6:37

GoogleCodeExporter commented 9 years ago
made to cocos 0.6.0

Original comment by ccanepacc@gmail.com on 10 Apr 2014 at 2:01