I have this code and I want to make the square disappear when clicking a key and two seconds after clicking it, the square reappears in another position.
float recX, recY;
rect(recX, recY, cuadrado, cuadrado);
void keyPressed ()
recX = random (width);
recY = random (height);