Can anyone tell me why this is not creating the correct complex physics body? It is not meant to be square…
[lua]display.setStatusBar(display.HiddenStatusBar)
local physics = require(“physics”)
physics.start()
physics.setGravity(0,0)
physics.setDrawMode(“hybrid”)
function createBody( design )
local body = display.newGroup()
for t=1, #design do
local s = design[t].shape
for i=1, #s-2, 2 do
local line = display.newLine( body, s[i], s[i+1], s[i+2], s[i+3] )
line.width = 3
end
local line = display.newLine( body, s[1], s[2], s[#s-1], s[#s] )
end
physics.addBody( body, “dynamic”, design )
return body
end
local large = {
{ friction=0, bounce=0, density=1, shape={ 19,-61 , 71,-39 , 83,-51 , 119,-25 , 109,45 , 65,51 } } ,
{ friction=0, bounce=0, density=1, shape={ 65,51 , 27,79 , 23,35 , -31,3 , -3,-23 , 19,-61 } } ,
}
local a = createBody( large )
a.x, a.y = 200,200[/lua]
[import]uid: 8271 topic_id: 22435 reply_id: 322435[/import]