Now we’re going to begin doing more interesting things with our particles. Since we have a decent (yet small) PVec class to maintain details about location and motion, we’ll begin to map out interactions between particles.For this to work, we need to be able to pass the entire arraylist of particles to each particle, which we then use to compare a local particle with a remote particle, one by one each time we redraw.This first example will loop through all available particles, drawing lines between particles within a particular distance (in this case, ~100 pixels).Source Code