interpretLight calculates how much light the Penguin is exposed to and adjusts the velocities accordingly. Check my distance with every other Penguin, if I'm closer than half my diameter plus half their diameter (if we've collided) figure out our relative velocity, and adjust mine and the other's velocities away from each other.
Source code: Penguins
Built with Processing