As for your question relating to grouping in physics editor, it isnt really a problem as all the tables are automatically created by physics editor in a separate lua file.
All you need to worry about is placing your tiles and calling something like
physics.addBody(image, physicsData:get("image@2x"))
this will pull the physics data that relates to that image when you auto trace it in Physics Editor.
Even though many shapes may be created, its all held in a table, but only needs to be called once as the above example. “Image@2x” might be a piece of terrain with many bumps, and therefore all collisions will work fine.
For instance you could auto trace many objects in PhysicsEditor, and save it through the software as myphysics.lua
In this file will be data similar to this which represents many shapes for one image:
["image@2x"] = {
{
pe\_fixture\_id = "", density = 2, friction = 0, bounce = 0, isSensor=true,
filter = { categoryBits = 1, maskBits = 65535, groupIndex = 0 },
shape = { 14, 193 , 3, 199 , -3, 191 , 14, 185 }
}
,
{
pe\_fixture\_id = "", density = 2, friction = 0, bounce = 0, isSensor=true,
filter = { categoryBits = 1, maskBits = 65535, groupIndex = 0 },
shape = { -113, 146 , -85, 168 , -74, 186 , -91, 178 , -105, 169 , -118, 152 }
}
,
{
pe\_fixture\_id = "", density = 2, friction = 0, bounce = 0, isSensor=true,
filter = { categoryBits = 1, maskBits = 65535, groupIndex = 0 },
shape = { -41, 185 , -29, 199 , -74, 186 , -85, 168 }
}
,
{
pe\_fixture\_id = "", density = 2, friction = 0, bounce = 0, isSensor=true,
filter = { categoryBits = 1, maskBits = 65535, groupIndex = 0 },
shape = { -3, 191 , 3, 199 , -29, 199 , -41, 185 }
}
}
Even if you need 100 images with physics it will all be in this one file.
I know it isnt free, but it saved me far more time than I care to think about. I cant live without it now. Worth every penny and then some. There is some example code with it to get you going.
Typical usage is
local scaleFactor = 1.0
local physicsData =(require "shapedefs").physicsData(scaleFactor)
local shape = display.newImage("objectname.png")
physics.addBody( shape, physicsData:get("objectname") )
where shapedefs is your PhysicsEditor lua file [import]uid: 99431 topic_id: 25710 reply_id: 104098[/import]