FALLING SAND GAME

FLEX FRIDAY SESSION

Introduction

    At age 8, when I discovered you could sneakily play online games during typing class, my brain was opened to dozens of worlds of seemingly unlimited entertainment. Among those worlds exist Falling Sand games, where pixels on the screen represent elements (grains of sand, drops of water, seeds, particles of fire, etc.), and the player has godlike control of a box where the possibilities seem endless. My childhood favorite is actually still online, but the genre has evolved in big ways ever since, culminating in the hit indie game Noita:

    The engine at the core of these games is actually the same as Conway's Game of Life (from my previous Flex Friday Session) - CELLULAR AUTOMATA! As a recap, Cellular Automata are machines we can program that simulate natural behavior with pixels on a grid. These pixels have discrete states, such as on/off (as seen in Game of Life), or sand/water/air (as we will see today). While the behaviors that emerge from these systems may appear complex, the programming at their core really just involves setting up some simple rules for how each pixel should behave on any given frame.

Demonstration

Here's a simple demo program I set up that is reasonable for us to complete today.

Control Effect
Left Mouse Drop particles (while held)
0-2 Set Element (Air, Sand, Water)

What we will do in the session...