When objects interact, we can trigger an event or effect to show that an interaction has occurred. We'll use Processing to show how to implement object interactions in a simulation environment.
For this tutorial, we'll create Particle
objects (displayed as ellipses) that move around the screen. When two particles come within a certain distance of each other, an ellipse will pulse from the center of each particle. The ellipse will grow to a specified size, then disappear.
First let's create the base Particle
class with some physics to move around.
class Particle {
PVector pos;