⌨️ Add a conditional to detect when the ball hits the right wall
In plain English, this new code says:
“If the x-position is greater than or equal to 400…”
Remember that 400 is the canvas width, and if x is greater than or equal to 400, that means x is touching (or past) the right edge of our canvas.
That sounds like a great place to reverse the circle’s direction of travel! 🤔