Simple sand and water simulation.
Button 0 = Reset
Button 3 = Spawn water line
Button 4 = Spawn sand pixel
Button 5 = Spawn sand line
Could be optimized by removing static sand and water particles from the list + optimizing the update order.
Not really much of a game yet but is fun to play around with. Thinking of trying to make a puzzle game with this involving scales.
Got a grip of things I have to finish on PICO-8 before I take on anything new, but this is certainly relevant to things I want to build up to!
How hard is it to implement different kinds of liquids into this too? Like say, oil that floats (but not instantly), or ice/steam variants that interact with said stuff (like ice that floats on the water, but can be melted and added to the water)?
Hey, I made the beginnings of the UI!
Also, there's an erase tool, but if there's a lot of particles on the screen, it turns into a slideshow.
Snowy days are the best, aren't they?
Shouldn't be too hard especially if you generalize all the functions and enable depending on the material. (Water is basically sand + 3 extra functions) For liquids I would make an index of densities and based on that determine which liquid would go on top. (Water first checks the pixel below it and if it's oil you could switch their positions) The only problem is that with each addition the amount of calculations increases but at the moment you can easily spawn 2000+ particles and experience no lag and that is without optimization.
Wow, very cool! Will make testing a lot easier. :) Thanks! Wondering why the cpu is so low when not erasing but skyrockets when erasing though. I'm guessing that for some reason the cpu is not displayed correctly when not erasing. Will check tomorrow.
Ah, I see. Because the updating isn't done in the _update it isn't added to the cpu statistic. That's why the erasing does show up and the updating doesn't.
[Please log in to post a comment]