// Update point
point.x = input.getMouseX();
point.y = input.getMouseY();
// Apply dampening
speed.sub(dampening);
// Move player
if(range.intersects(MouseGhost.rect)) {
// Update speed/direction
speed = point.sub(pos).normalise().negate();
pos.add(speed.scale(point.distance(pos)/100));
}
Basically I’m checking if the mouse is inside the range of the tile. If so I want it to increase the speed. Then when the mouse leaves the range, I’d like it to continue on a bit. I figured if I subtracted the dampening vector from the speed vector it would slow down but that doesnt seem to do it. What am I doing wrong?