i have to do ball Flying left, and when it reach wall it return
Hello, and welcome to the forum!
Nice to have you here.
You need a Sketch with setup and draw.
Please use ellipse command to draw a circle:
Then replace the y value with a variable y and say
Processing has several “bouncing” examples:
The term for knowing when to bounce is “collision detection.” You can find several good tutorials on collision detection in Processing with examples, here is one: