FloraJS has some built in Proximity objects that exert a force on Agents that come in direct contact or land within the object's range of influence.
- Liquid
- Attractor
- Repeller
In the example below, we create a Liquid object and an Agent that follows the mouse. You can click and drag to place the Liquid anywhere in the World. Use your mouse to make the Agent pass through the Liquid.
You can replace 'Liquid' with 'Attractor' and 'Repeller' to view how the Proximity objects affect an Agent.