Hello,
I am making a collision ball and ball1, when they hit a linear impulse is added. But the code that i have been using does not have been successfully working. What is wrong?
function ball:collision( event )
if event.phase == “began” then
ball:applyLinearImpulse(0, -0.2, ball.x, ball.y)
end
return true
end
I have also tried doing some things like this :
But have failed.
function ball:collision(e)
if(e.phase == “began”) then
if(e.other.type == “ball”) then
ball1:applyLinearImpulse(0, -0.2, ball.x, ball.y)
end
ball:addEventListener(“collision”, ball)
Thank you. [import]uid: 23689 topic_id: 10836 reply_id: 310836[/import]