ball leaves path when it bounces around

So I have a short physics thing with a ball that bounces around but it leaves a weird path of the past places it had been. Here it is. Tell me what I did wrong

function setup()

background(0, 0, 0, 255)
stroke(255, 255, 255, 255)
top = physics.body(EDGE, vec2(0, HEIGHT), vec2(WIDTH, HEIGHT))
left = physics.body(EDGE, vec2(0, 0), vec2(0, HEIGHT))
right = physics.body(EDGE, vec2(WIDTH, 0), vec2(WIDTH, HEIGHT))
bottom = physics.body(EDGE, vec2(0, 0), vec2(WIDTH, 0))

ball = physics.body(CIRCLE, 10)
ball.position = vec2(WIDTH/2, HEIGHT/2)
ball.linearVelocity = vec2(200, 200)
ball.restitution = 1.1
ball.friction = 0
ball.type = DYNAMIC
ball.gravityScale = 3
function draw()
    ellipse(ball.x, ball.y, 20)

The command “background” should be in draw, not in setup.

The problem is you aren’t clearing the screen each time you draw. That’s what background is for.

@Ignatz Thanks!