it's just going the wrong direction... i want it to go where the event happen, any suggestions ?
agk::LoadImage(2, "cube.png");
imgX = agk::GetImageWidth(2);
imgY = agk::GetImageHeight(2);
agk::CreateSprite(2, 2);
agk::SetSpritePhysicsOn(2, 2);
agk::SetSpritePhysicsCanRotate(2,0);
agk::SetSpritePhysicsMass(2, 5);
currentX = agk::GetSpriteX(2);
currentY = agk::GetSpriteY(2);
if (agk::GetPointerPressed() == 1) {
eventX = agk::GetPointerX() - (imgX / 2);
eventY = agk::GetPointerY() - (imgY / 2);
fixedX = currentX - (imgX / 2);
fixedY = currentY - (imgY / 2);
agk::SetSpritePhysicsImpulse(2, fixedX, fixedY, (fixedX - eventX) * speed, (fixedY - eventY) * speed);
}