This is awesome! A few years ago I built a more rudimentary version of a falling sand game with just Javascript and WebGL: http://ericleong.me/sand.js/
I tried to embed the "scripting" language as a texture in WebGL to keep the implementation very fast (note that every pixel is a cell), but I think I worked myself into a corner.
When I last explored this idea, "stickers" are necessary since most surfaces in real life are generic "textures", so there's no way to know which section of a wall you're looking at if you're too close to it.
Interesting how it's in 3D, and pretty interesting considering how early it was done. (back before all the Oculus hype) Oh and sorry what I meant by stickers were colorful cartoon drawings popular in Facebook and LINE. Although what you're saying does make sense in regards to manipulating surfaces.
Problem is... that code is an asset, until it's not. As most cases, it depends on the project, but changes in requirements have insidious effects on code, which might turn your asset in a liability before you realise it.
Awesome! Replacing one block with another is clever, although it's tricky when organisms of one species are adjacent to organisms of another species.
I've played around with a similar idea in falling sand games [0], where individual cells interact to create new cells, but I got stuck developing a language flexible enough for greater expressiveness while still being performant.
You were developing a new language? Javascript is great because you can see the results in a browser. I'm a bit torn because java is easier for developing this kind of data intensive thing.
One of the "not good" explanations of this was probably mine (and I agree!) written many years ago [1]. I wish I could remember why my code ended up so much more complex.
I've done a lot of amateur research into this field, but I am by no means an expert. Either way, I have a few comments. Let's take this line for example:
ball.y += ball.vy;
ball.vy += gravity;
It looks okay and seems to match the constant acceleration kinematics formulas, but what we're really doing is Euler integration, a first-order numerical integration method. It's pretty bad even for numerical integration, so we should use fourth-order Runge-Kutta (RK4) instead [1].
Taking a look at the collision detection, look at this line of code:
ball.y = platform.y - ball.radius;
It works in the given situation, of course, but wait a minute - if the ball is moving at 5 cm/frame and, at that particular frame, happens to be 1 cm above the platform, then the ball will move only 1 cm/frame! This means that the velocity has apparently dropped to some nonsensical value! But we can't move it anywhere else, because we haven't checked for collisions yet, and this example also assumes that there is only one other platform the ball could collide with - if it was an acute corner of two platforms, then we're in a bit of a rough situation.
Lastly, in this particular line of code:
ball.vy *= -0.4;
The value, 0.4, is called the coefficient of restitution. In his particular case, where the platform is immovable, it's fairly reasonable (if we had immovable objects in reality!) but obviously a more sophisticated collision will need to consider energy factors.
I made a flash game at one point with gravity as the core feature, tuned the acceleration, etc, then added collision detection. The simplest way I found was to give everything a destination x, y first, then collision detection checked current to destination vector and updated destination with the results (drag, bounce, etc.). Destination then became current. The downside was the multi wall reflection caused n + 1 collision checks (n being number of collisions). This wasn't an issue for my game, but one with lots of collisions could have slowed it down.
I would like to a "loading" indicator too, but I'm not sure what the best way to integrate it is. I've noticed the other issues you've pointed out - there definitely needs to be some more refinement that needs to be thought about.
I tried to embed the "scripting" language as a texture in WebGL to keep the implementation very fast (note that every pixel is a cell), but I think I worked myself into a corner.
Source code here: https://github.com/ericleong/sand.js