Writing one of my first programs in Lua with the Corona SDK, and I’m getting the following error:
main.lua:10: bad argument #-2 to ‘addBody’ (Proxy expected, got nil)
Here’s my code. It’s probably just a stupid syntax error.
[code]local physics = require(“physics”)
physics.start()
local ground = display.newRect(160, 445, 160, 20)
ground:setFillColor(255, 255, 255)
local circle = display.newCircle(200, 150, 50)
circle:setFillColor(255, 0, 0)
physics:addBody(ground, “static”, {friction = 0.5, bounce = 0.3})
physics:addBody(circle, {density = 1.0, friction = 0.3, bounce = 0.2, radius = 50})[/code]
Thanks in advance. [import]uid: 30657 topic_id: 5769 reply_id: 305769[/import]
means member access requiring an object (dot or arrow in C++), while a dot (.) means static access (double colon in C++).