jfrech.com
jblog
table of contents

Sand

2015-10-04, post № 70

programming, Pygame, Python, #art, #background, #bridges, #falling, #grain, #grains, #sand, #shades

This program lets you watch grains of sand fall. The grains shift in color, according to the color algorithm assigned. You also can build bridges to change the sand’s falling behavior.

Controls

  • Left clicking spawns in new grains of sand,
  • Right clicking draws a bridge,
  • ‘Space’ saves a screenshot.
sand-7.png
sand-4.png
sand-10.png
Source code: sand.py