When working in P5.js, I notice that any shape I draw seems to leave a faint trail as it moves.
For example, when drawing an ellipsehttps://i.sstatic.net/C61YO.png
Here's the code I used for testing purposes:
function draw() {
if (times < 100) {
fill(255);
ellipse(times, times, 10, 10);
times++
}
}
I attempted incorporating erase()
, which did fix the issue along with redrawing the background. However, this solution would clear the canvas every frame, which is not ideal for my intended outcome.