Help!?

I’m using this function to move the circle!

How can i display the invisible line that i draw to applay the impulse to the circle???

  physics.start()    function circleT(event) if event.phase == "began" then display.getCurrentStage():setFocus(circle)   else if  event.phase == "ended" then   circle:removeEventListener("touch", circleTouch)   circle:applyLinearImpulse(event.xStart - event.x, event.yStart - event.y, circle.x, circle.y) display.getCurrentStage():setFocus(nil)           end end end     circle:addEventListener("touch", circleT)  

Try this:

require("physics") physics.start() physics.setGravity(0,0) physics.setDrawMode("hybrid") local ball = display.newCircle( display.contentCenterX, display.contentCenterY, 40 ) physics.addBody( ball, "dynamic", { density=1, radius=40 } ) function ball:showLine(e) if (ball.line) then ball.line:removeSelf() ball.line = nil end if (e) then ball.line = display.newLine( e.xStart, e.yStart, e.x, e.y ) ball.line.width = 5 end end function ball:touch(e) if (e.phase == "began") then display.getCurrentStage():setFocus( ball ) ball.hasFocus = true ball:showLine(e) return true elseif (e.target.hasFocus) then if (e.phase == "moved") then ball:showLine(e) else ball:showLine() ball:applyForce( e.xStart-e.x, e.yStart-e.y, ball.x, ball.y ) end return true end return false end ball:addEventListener("touch",ball)

@tramoaie.at ***PLEASE*** stop using titles like " Help!".  Put a short one line statement on what it’s about.  We’ve asked you do to this several times.   These are bad post titles and hurt your ability to get the help you need.   

Ok…Sorryyy!!!

Try this:

require("physics") physics.start() physics.setGravity(0,0) physics.setDrawMode("hybrid") local ball = display.newCircle( display.contentCenterX, display.contentCenterY, 40 ) physics.addBody( ball, "dynamic", { density=1, radius=40 } ) function ball:showLine(e) if (ball.line) then ball.line:removeSelf() ball.line = nil end if (e) then ball.line = display.newLine( e.xStart, e.yStart, e.x, e.y ) ball.line.width = 5 end end function ball:touch(e) if (e.phase == "began") then display.getCurrentStage():setFocus( ball ) ball.hasFocus = true ball:showLine(e) return true elseif (e.target.hasFocus) then if (e.phase == "moved") then ball:showLine(e) else ball:showLine() ball:applyForce( e.xStart-e.x, e.yStart-e.y, ball.x, ball.y ) end return true end return false end ball:addEventListener("touch",ball)

@tramoaie.at ***PLEASE*** stop using titles like " Help!".  Put a short one line statement on what it’s about.  We’ve asked you do to this several times.   These are bad post titles and hurt your ability to get the help you need.   

Ok…Sorryyy!!!