I have tried changing this line -xVel = xVel*0,999- here but I can’t find a way to make the ellipse more gradually lose speed. Here is my code
float ellipseXPos = 300;
float ellipseYPos = 300;
float xVel = 1;
float yVel = 1;
void setup() {
size(600, 600);
background(0);
frameRate(30);
}
void draw() {
background(0)
ellipseXPos = ellipseXPos + xVel;
ellipse(ellipseXPos, ellipseYPos, 40, 40);
xVel = xVel*0,999;
if (mousePressed) {
xVel = mouseX/10-ellipseXPos/10;
print(xVel);
}
}