Hello @maverick24,
You will need to check the distance between objects. And this can be done with the dist() function. Excellent tutorial here by Abe Pazos on youtube on how to use:
Also, I recommend looking in reference section of processing.org site.
As well as this example in the examples section for slightly more advanced implementation:
Circle Collision with Swapping Velocities / Examples / Processing.org
![]()