If you're not sure what this project is, see the Notes and Credits section. [NOTICE: this project requires a keyboard.] Press the Green Flag to get things started. Press [M] to toggle Dark Mode if you want. When you first boot up the project, the simulation will be paused. You can play and pause it again by pressing the [SPACE] bar. When the simulation is paused, you can edit the environment, add and removing stuff. Click and drag to draw walls. (Most) particles cannot pass through them. Press [A] to add red particles, [S] to add blue ones, and [D] to add green ones. Red, blue, and green particles all behave the same way. They will move around randomly but cannot pass through walls or other particles. Press [J] to add yellow particles, [K] to add cyan ones, and [L] to add magenta ones. Yellow, cyan, and magenta are "special" particles, meaning they behave a bit differently. Yellow particles can pass through other particles. Cyan particles can pass through walls. Magenta particles can pass through both. You can't have more than 300 particles at once (because of Scratch's clone limit). If you try to place particles on top of a wall or each other, they will automatically move until none are overlapping (unless, of course, those are special particles which are able to overlap). While the simulation is paused, press [X] + [Z] to clear all walls, and [X] + [C] to clear all particles. You can also selectively delete a specific type of particle by pressing [X] + [that particle type's corresponding key]. Press [I] to see more info. You'll see two sliders at the top: "Step Rate" changes how many steps per second the simulation runs at. I'm not sure what the actual limit is, but the slider goes up to 50. "Heat" changes how far the particles move each step. Be careful; if the Heat is too high, particles will essentially be able to jump through thin walls and each other. You'll also see two other numbers at the bottom: "Playing?" tells you if the simulation is running. "1" means it's running, "0" means it's paused. "Steps Elapsed" tells you how many steps have run in the simulation so far. You can reset this number by pressing [X] + [V].
This project simulates diffusion, which is the name of the process by which particles tend to spread out when moving around randomly. Think about what would happen if you put a drop of ink in a cup of water. The ink molecules would naturally spread themselves out (or diffuse) among the water molecules until they're pretty much evenly mixed. This project doesn't perfectly simulate diffusion (my coding skills aren't that great), but it's good enough for me. I'm sure you can find better simulations out there if you look. Using this project, you can set up the starting conditions (add walls, containers, different kinds of particles, etc.) and see how the particles spread out over time. I find it quite fun to watch. Let me know if you find any problems. I might fix them! -_-_-_-_-_-_-_-_-_-_CHANGELOG_-_-_-_-_-_-_-_-_-_- 7/7/2026 + Shared project + Minor fixes 7/9/2026 + Added the ability to selectively delete a specific type of particle