Helppp, i can find the error:
local W = display.contentWidth local H = display.contentHeight local physics = require ("physics") physics.start() physics.setGravity(0, 5) physics.setScale(50) local circle = display.newCircle(367, 870, 50) physics.addBody(circle,"dinamic", {density = 1.0, friction = 0.3, bounce = 0.2}) local ground = display.newRect(0, 1280, 720, 1) physics.addBody(ground, "static", {}) local roof1 = display.newRect(0, 0, 180, 1) physics.addBody(roof1, "static", {}) local roof2 = display.newRect(540, 0, 180,1) physics.addBody(roof2, "static", {}) local wallL = display.newRect(0,0,1, 1280) physics.addBody(wallL, "static", {}) local wallR = display.newRect(720, 0, 1, 1280) physics.addBody(wallR, "static", {}) local bar1 = display.newRect(720/4,0, 15, 100) physics.addBody(bar1, "static", {}) local bar2 = display.newRect(540, 0, 15, 100) physics.addBody(bar2, "static", {}) local from\_x = bar1.x local from\_y = bar1.y local to\_x = bar2.x local to\_y = bar2.y local hits = physics.rayCast( from\_x, from\_y, to\_x, to\_y, "closest" ) if hits[1].object == circle then print ("You Win") end circle:addEventListener("Runtime", enterFrame) function circleTouch(event) if event.phase == "began" then display.getCurrentStage():setFocus(circle) else if event.phase == "ended" then circle:applyLinearImpulse(event.xStart - event.x, event.yStart - event.y, circle.x, circle.y) display.getCurrentStage():setFocus(nil) end end end circle:addEventListener("touch", circleTouch)