use of shape in physics.addbody( )

shape attribute is available in physics.addbody()

An example i tried is as follows.
man = "man.png"
shape1= man.x,man.y,man.x+201,man.y,man.x+201,man.y+201,man.x,man.y+201}
physics.addBody(man,"dynamic",{density = 2,bounce = 0, shape=shape1})

This man object gets separated from all other objects. It dont collide and stop with static objects. Then what is the exact use of this shape attribute???

You tried that exact code? If so, yeah, that wont work.

1
2
3
local man = display.newImage("man.png")
shape1= {man.x,man.y,man.x+201,man.y,man.x+201,man.y+201,man.x,man.y+201}
physics.addBody(man,"dynamic",{density = 2,bounce = 0, shape=shape1})
views:1455 update:2011/9/26 15:43:22
corona forums © 2003-2011