(AGK version: 108.14)
Submitted: 2014-03-02 21:58:15
setVirtualResolution(640,480)


n = createSprite(0)
setSpriteSize(n , 100, 100)
setSpriteOffset(n, 50, 50)
setSpritePhysicsOn(n, 2)

createMouseJoint(n, 50, 50, 25000)



setPhysicsDebugOn()


repeat

    x = getPointerX()
    y = getPointerY()

    SetJointMouseTarget(n, x, y)


    drawLine(x, y, getSpriteXByOffset(n), getSpriteYByOffset(n), 255, 0, 0)

    sync()
until getRawKeyPressed(27) = 1
end
Help make AGK better by submitting an example for this command!
(All examples are subject to approval)
Login to post an example of your own.