bodyType is a special value; it’s not added (not even in “normal” circumstances) from within the physics table. So when you want to set the bodyType, you have to just add it to the object, not the physics table (which means bodyType isn’t prefixed by physics:).
As for properties for the objects, use the objects: prefix:
[lua]
objects:bodyType = static
[/lua]
For tile layers, note that this prefix is tiles: instead.
Working with Tiled, I created some platforms from lines. I had a problem where the “player” object jumps visibly above a platform but it still passes through. If the player object gets high enough above the platform it will land on it. Trying to sort the problem out I was looking at the bounds of the platforms. The platforms were drawn as single lines with two points in Tiled. When I examine the bounds in Corona these lines appear to have a height of 12pixels!
If I draw a platform as a box, with a height of 0, the bounds work out correctly. Though in Tiled it’s impossible to get to the properties of an object with 0 height.
This picture shows Tiled in the background. The red lines are platforms. In the Corona simulator in the foreground you can see magenta rectangles. I drew these using the contentBounds of each of the line platforms.
Not sure what I’m doing wrong here. I have an objects layer in Tiled. If I set properties on the Layer all the objects the properties. If I set the same properties on objects individually they don’t seem to get the properties. For example, I set the layer properties as:
objects:collisionType = platform <-- works fine
Setting the same property on an object has no effect. Setting the property as: collisionType = platform, doesn’t work either.
The platforms were drawn as single lines with two points in Tiled. When I examine the bounds in Corona these lines appear to have a height of 12pixels!
This could be because of the display part of the line; Dusk gives line objects strokeWidth so that you can see them for debugging.
To see your line objects, use this:
[lua]
dusk.setPreference(“virtualObjectsVisible”, true)
[/lua]
Everything is working for me, so I’m not sure what’s happening. If this issue turns out to be a real problem, can you file an issue with a test case included at the GitHub page?
Same with the property thing; setting it on the object works for me.
My work around was to use rectangles for platforms. In Tiled, if you set these to 0 height you can’t select them, which is frustrating. Be sure to set the height! This was a problem I was having with the Platformer, in the previous Ceramic demos. Many of the platforms were unelectable, which I realize now was due to the 0 height.
I just did a quick test to print the size of a line element in the terminal. It showed a height of 12 pixels with the virtualObjectsVisible true or false. I’ll make a test example and file an issue later today.
The limit is a maximum file dimension (width and height). Check the the dimension on your file, if it’s larger you can break your tiles into two sheets.
If you’re testing in the simulator this is probably not a problem. I don’t think the simulator recognizes this limit.