Reactive water demo

2023-06-12に共有



Hello!

This is my first experiment using pico-8, a basic water simulation that hopefully is simple enough to be used in other projects.

The two main things used to make this simulation is;
1) A vertical force applied to each point on the water surface, positive if the point is below "sea level" and negative if it is above the same point.
2) Diffusion of each point relating to its neighbours, which looks like this;

Where dt is time since the last frame, diff & damp are value multipliers and pt(n) being a function that returns the values from the points[] array, making sure none of them encounter any index errors.

Like I said, this is my first attempt at using pico-8, so if I've made any really silly mistakes, please do let me know as it's the only way I'll ever learn!