如何在Corona SDK中击打另一个物体并施加力以使其移动

我想用力量移动一个物体,并且那个特定的物体将撞击其他物体,并使其朝施加的力量方向移动,这将取决于施加的力量的大小,我正在尝试根据鼠标移动的距离计算施加的力量大小,但是用户可以多次点击其他物体,而无需松开鼠标拖动按钮,请提供任何想法..谢谢...

  local physics = require("physics")
physics.start()
physics.setGravity(0,0)
physics.setDrawMode("normal")

local source
local target

local function onCollision( event )
     if event.object1.name == "object1"  and event.object2.name=="object2" or event.object1.name == "object2"  and event.object2.name=="object1" then
          target:applyForce(source.x_force, source.y_force, source.x_direction, source.y_direction )
     end
 end

Runtime:addEventListener("collision",onCollision)

local function move( event )
    local t = event.target
    local phase = event.phase
    if "began" == phase then
        local parent = t.parent
        display.getCurrentStage():setFocus( t )
        t.isFocus = true
        -- 存储初始位置
        t.x0 = event.x - t.x
        t.y0 = event.y - t.y
    elseif t.isFocus then
        if "moved" == phase then
            t.x = event.x - t.x0
            t.y = event.y - t.y0

            source.x_direction=(t.x0-event.x)
            source.y_direction=(t.y0-event.y)
            source.x_force=t.x0
            source.y_force=t.y0

        elseif "ended" == phase or "cancelled" == phase then
            display.getCurrentStage():setFocus( nil )
            t.isFocus = false
        end
    end
     return true
end

 target = display.newCircle( 250, 250, 60 )
target.x = 200; target.y = 500
target:setFillColor(240, 200, 0)
target.name="object1"
physics.addBody(target,"dynamic",{radius = 70})

source = display.newCircle( 250, 250, 60 )
source.x = 650; source.y = 100
source:setFillColor( 240,125,0 )
source.name="object2"
physics.addBody(source,"dynamic",{radius = 70})
source:addEventListener( "touch", move)
点赞