I am trying to make a shape move in the direction of a mouse click for a certain distance. I have tried creating variables for the x and y of the mouse on-click event and the distance needed in x and y to get to the mouse click position and dividing + trunc the values to make the shape move in that direction using a timer, although my problem is I need the shape to move a specific distance no matter where the cursor is, just using the mouse click for direction, as well as the shape won't move at a constant speed using this method.

Current code:
on mouse down:

```
mx := x;
my := y;

```

Timer:

```
shape1.left := shape1.Left + (mx - shape1.left + 8) div 32;
shape1.top := shape1.top + (my - shape1.top + 8) div 32;

```