Sand simulator

Sand simulator

14 devlogs
13h 43m
•  Ship certified
Created by Mahit Marri

Sand that falls (and those some other stuff)
I have created a trinket page for the demo, it's really slow but I don't mind if you copy paste my code into your own vscode file to try it out.
(instructions are also on the trinket)

Timeline

Final devlog to show off the completed project.

This is mainly to be an alternative incase the demo doesn't work.

Ship 1

1 payout of shell 273.0 shells

Mahit Marri

about 2 months ago

Mahit Marri Covers 13 devlogs and 13h 35m

Final bug fixes, changed ui for some features, added an eraser mode (bound to E), and worked on making it into an exe.

Update attachment

The project is now complete, this last develop is for the final feature which is a function that takes a picture and converts it into sand particles.

Just some bug fixes, program crashed whenever an unbound key was pressed.

Update attachment

I added an input feature so the user can add their own custom colors. press enter to open the input box, enter again to confirm. The custom color will be bound to the C key.

Mahit Marri Mahit Marri about 2 months ago
I uploaded the wrong video, but this still should show how the text input works.

I added more colors and different placement sizes.

Mahit Marri Mahit Marri about 2 months ago
It seems kinda laggy with the higher placement options but that’s fixed now

added multiple colors. Press R for red, B for blue, g for green, and S for sand colored sand.

I added horizontal acceleration but I can't tell if it looks better without it or not

BlueDragon_space BlueDragon_space about 2 months ago
It looks a lot cooler with horizontal acceleration!I would keep it in! :)

I added gravitational acceleration to the sand. I ran into an issue where no sand was being placed after I added the gravity changes but then I realized it was because the velocity started at 0 so the particles spawned in unmoving and then got replaced all in one frame. I'll add horizontal acceleration next.

No changes to the actual function of the simulation but now it stops rendering when nothing is changing. This is mainly to stop my computer from heating up

Update attachment

Turns out I did not fix the left bias issue, I did that now. I also changed the colors a bit.

Kip Kip about 2 months ago
Looks cool!

I made the pixels bigger and fixed a left bias with the cascading effect

Mahit Marri Mahit Marri about 2 months ago
I just realized I forgot to rerun the program with the addition of the code that removes the left bias, so the video still has it.
Mahit Marri Mahit Marri about 2 months ago
I also add more pixels to be dropped from around the mouse click location, and randomized how may would be made in a frame

I figured out how to make each pixel maintain its color by creating an object to represent each one. Then I added the settling by having each particle check if there's sand in the diagonals below it.

sand falls but the next thing I want to add is slightly randomized shades of sand grains. The problem right now being that the sand does not maintain the same color.