Hello,
Thanks for taking the time to click on this query.
I’m currently learning how to bounce balls around the window, and wondered whether it is possible to make the ball see the trail it leaves behind it and interact with said trail if it comes back into contact with it.
The x and y coordinates of the ball (coloured white) are continually checked against the position of the ‘walls’ (for lack of a better word), in order to know when it is ‘bounce’.
With the background(0) function omitted from the draw loop (but not from setup), as the ball bounces around the window, it leaves a white trail behind it.
Is it possible to make the ball to see this trail, and treat it like a wall, and bounce accordingly.
I’m sure this is, but being relatively new to Processing / coding, I’m not sure what technique / approach would be used to achieve this i.e. is it possible to interrogate the colours (ahead of the ball) in the window itself as they develop, or would I have to keep a record of all of the ball’s x & y coordinates and check against its current position to know when to bounce or not etc.
Many thanks,
Scolty