Attraction and Repulsion


A particle wanders through a grid of cells, leaving a trail of points behind it. When in a cell, it is attracted to the center of that cell. It is also repelled by its previous trail of points.

Although the center attraction is stronger than the point repulsion, eventually the cell fills up with so many trail points that the particle is pushed into another cell.

Behavior emerges. Hilarity ensues. A good time was had by all.

Reminds me of a bee visiting flowers in a field.

Occasionally Eventually the particle either gets stuck or disappears. Shrug. Probably shouldn’t leave this running unattended for long periods of time.

Source (Warning – very unpolished code. Programmer discretion is advised.)

Controls: MiniComps

Graphics: BLJS

Support this work

Leave a Reply

Your email address will not be published. Required fields are marked *