Move your mouse to protect the ball from the edges.
This is not completely original. I used a tutorial and I once saw a project with four paddles.