It is possible, the Physics Object can do it. There is an example in there which uses it which has loads of objects all colliding off each other and fully functional.
Printable View
I am still wanting to do this, but with bigger objects. Like instead of sand it could be stones. So when one stone hits another it needs to drop to the side if there is space. Do anyone know of a formula to use for this? I would like to just use Box2D really, but not if that is not planned to be ported in the near future.. :/
1
If you want the particles to NOT be pasted as Obstacles ( which disables them from moving ever again ), you will have to handle the Collision Mask Lag issue, to make the Particles correcly interact so that the basic system works.
Fortunately, someone ( dont remeber who ) did find a solution to the collision mask lag problem.
The solution to the CML problem is to ( 1 ) move the Particles ( 2 ) Destroy them and create new Particles in their place ( this will uppdate all collision masks to the Objects current possitions ) ( 3 ) Do collision checking
Once you have done this you will have a system, exactly like the example mfa, where each single pixle Particles move through a Grid System and interact/ react to eachother.
2
Now that you have a working system where Particles progress through a 1x1 based grid system, you need to resize the grid system to, lets say, a 32x32 based grid system.
So instead of using 1x1 Square Particles, you use 32x32 Square Particles as collision masks, and you can super impose/ attach different graphics ( like round rocks ) ontop of the Masks.
However with this new 32x32 based grid movement system, the Object or Particles will move in increments of 32x32 kinda ( if you can visualize it ), which doesnt look to good.
At this point you simply, as the Particles move, store the Particles old and new coordinates in the 32x32 Grid System and create a smooth movement from point A ( old position ) to B ( new position ) inbetween each MovementStep/ each time all particles move 1 step.
...
Sorry for being confusing.
OLD. You can look at the example on my website. After you see the example you will know.
Marv
I uploaded an example in the first post. I basically want the falling sand but to be able to interact with it. But I dont really need those small sand corns. Hm you could say I want to achieve what you can achieve with Box2D in simulating stones. They dont need to have the same fancy physics, but if there are 20 stones they should at least be able to be dropped down and stacked and falling to the sides if there are room. It seems so simple, but I have no idea how to do it even half good without Box2D :S