Below is a sample code of 2 “newCircle” objects, right/left walls and a floor. The reason a floor was added is because I thought maybe if the larger circle was “static” it would behave as a square. From what I can tell, round objects don’t really work in Corona for collission. Everything acts as squares.
Can someone confirm this, or tell me how to fix this so that the small circle interacts with the large circle as real physics would define it.
physics = require(“physics”)
physics.start()
local leftWall = display.newRect (20, 1, 1, display.contentHeight)
local rightWall = display.newRect (display.contentWidth-20, 1, 1, display.contentHeight)
local floor = display.newRect (0, display.contentHeight, display.contentWidth, 1)
physics.addBody (leftWall, “static”, {bounce = 1, density=1, friction = 20})
physics.addBody (rightWall, “static”, {bounce = 1, friction = 20})
physics.addBody (floor, “static”, {bounce = 0.08, friction = 10, filter=floorFilter})
local mySquareCircle = display.newCircle( 400, 500, 300 )
mySquareCircle.strokeWidth = 3
mySquareCircle:setFillColor(140, 140, 140)
mySquareCircle:setStrokeColor(180, 180, 180)
display.setStatusBar( display.HiddenStatusBar )
local myCircle = display.newCircle( 100, 100, 30 )
myCircle:setFillColor(128,128,128)
physics.addBody( mySquareCircle, “dynamic”, { friction=0.5, bounce=0.3 } )
physics.addBody( myCircle, “dynamic”, { density = 1.0, friction = 0.3, bounce = 0.2, radius = 25 } )
myCircle:applyForce(50)
[import]uid: 32936 topic_id: 6125 reply_id: 306125[/import]
[import]uid: 32936 topic_id: 6125 reply_id: 21060[/import]
[import]uid: 6645 topic_id: 6125 reply_id: 21062[/import]