I am trying to get an app that will create a ball and it will bounce across the screen as you drag over it.
Here is my function.
local function spawnBall( event )
local phase = event.phase
if “ended” == phase then
myLabel.isVisible = false
physics.addBody( ball, { density = 1.0, friction = 0.3, bounce = 0.2, radius = 25 } ) ball.linearDamping = 0.4
ball.angularDamping = 0.6
ball:addEventListener( “touch”, dragBody ) – make object draggable
end
end
Runtime error
/Users/andrew/Dropbox/Manual Bouncing Ball/main.lua:56: ERROR: table expected. If this is a function call, you might have used ‘.’ instead of ‘:’
stack traceback:
[C]: ?
[C]: in function ‘addBody’
/Users/andrew/Dropbox/Manual Bouncing Ball/main.lua:56: in function
?: in function <?:214>
Line 50 is the introduction local function spawnBall
Line 56 is physics.addBody
Any help will be appreciated I am stuck.
[import]uid: 41573 topic_id: 7246 reply_id: 307246[/import]