I am having trouble using the director class when using the physics API. I have made a small example below. As soon as I add the physics.addBody line the simulator will crash. The code below is loaded by a director:changeScene in another module that also loads the physics package.
What I am doing wrong here?
Thanks
Thomas
[code]
module(…, package.seeall)
local gameGroup
function new()
gameGroup = display.newGroup()
local background = display.newRect(0,0,display.contentWidth,display.contentHeight*2)
background:setFillColor(255,255,255)
gameGroup:insert(background)
local bottomEdge = display.newRect(0,display.contentHeight*2,display.contentWidth, 10)
bottomEdge:setFillColor(255,0,0)
physics.addBody(bottomEdge, { density = 1.0, friction = 0.3, bounce = 0.2 } )
gameGroup:insert(bottomEdge)
return gameGroup
end [import]uid: 21783 topic_id: 6140 reply_id: 306140[/import]