title: How do those java sand games keep track of so many particles?
body: <p>Can anyone shed any light on how a program like that might be structured?</p>
  
  <p>What java classes would they employ to keep track of so many particles and then check against them for things like collision detection? Particles need to know what particles they are next to, or that they're not next to anything so they can fall etc.</p>
  
  <p><a href="http://fallingsandgame.com/sand/" rel="nofollow noreferrer">Here's</a> an example, incase you're not sure what a sand game is.</p>