Hi all,
new to p5 and am a bit confused. I am trying to make a rectangle move on a horizontal plane. To do this I am adding two vectors when the user presses the left arrow or right arrow.
The paddle is moving as intended, however, my rect is drawn with a trail behind it. Im not sure how or why this trail is being drawn. Could someone explain this?
My code for this example can be found here - you’ll have to click on the black background area before you press the arrow keys to move the paddle
https://editor.p5js.org/swood/sketches/S1kU6R1om
thanks!