I’m using build#761 now,
I was playing around with rag doll code, then I found this
when a rectangle collides with other physics object, it changing shape. colliding side of rectangle is vanished
here is the code
function createWalls()
--\> Create Walls
local walls = display.newGroup()
local leftWall = display.newRect (0, 0, 1, display.contentHeight)
local rightWall = display.newRect (display.contentWidth, 0, 1, display.contentHeight)
local ceiling = display.newRect (0, 0, display.contentWidth, 1)
local floor = display.newRect (0, display.contentHeight, display.contentWidth, 1)
physics.addBody (leftWall, "static", {bounce = 0.5, friction = 10})
physics.addBody (rightWall, "static", {bounce = 0.5, friction = 10})
physics.addBody (ceiling, "static", {bounce = 0.5, friction = 10})
physics.addBody (floor, "static", {bounce = 0.5, friction = 10})
walls:insert(leftWall)
walls:insert(rightWall)
walls:insert(ceiling)
walls:insert(floor)
return walls
end
local box = display.newRect(0, 0, 64, 256)
box:setFillColor(255, 0, 0)
box.strokeWidth = 3
box:setStrokeColor(128, 128, 128)
box.x = 160
box.y = display.contentHeight\*.5
physics.addBody(box, { density = 0.5, friction = 0.3, bounce = 0.2 })
createWalls()
I wanted to try new sprites. but now I changed my mind, going back to build#745 which seems reasonably stable though some facebook bugs are there in #745 also
edit:
Circle also losing its face, but you don’t have to add circle to physics. just draw circle at some x,y coordinates
local crcl= display.newCircle( 160, 160, 60 )
crcl:setFillColor(255, 0, 0)
[import]uid: 97420 topic_id: 22936 reply_id: 322936[/import]