★★★ SAND SIMULATOR ★★★ This is a sand simulator where you can play with sand and interact with it. ★★★ Controls ★★★ Mouse - Move around to push sand. Click - Drop New Sand Space - Draw solid ground X - Delete ground and sand R - Reset the level and start afresh P - Toggle Pause Mode ★★★ So how does it work? ★★★ I have 3 main lists in my scripts: L - Level Grid (a row for every possible pixel location) A - Active Sand (a list of the active sand locations on the grid) X - Invalidate (a list of screen locations that need repainting) I only look for movement of active sand pixels, and when one moves, it looks for new sand pixels to add to the active sand pixel list. The pushing of sand is done by tracing from the current mouse position across the sand piles looking for a possible empty space on the other side.
Thanks to all our faithful fans. Follow me on Instagram @sleepysavage21 Peace [+]