Share your repls and programming experiences

← Back to all posts
| S4ND | Super Satisfying Sand Simulator
h
RayhanADev (2594)

Hiya 0/!

So I recently got a new profile pic, and I guess I made a new game as well (two very irrelevant things)? Anyways I always thought falling sand games were super satisfying, so I made this basic falling sand game! So here we go...

Presenting... S4ND

Water Included

Want To Play It?

CLICK THIS LINK

You basically get to drop some sand, and it's super satisfying! Coding it took <canvas>, several ES6 Classes and I used external CSS (big wow right?).

ENJOY!

Comments
hotnewtop
FlaminHotValdez (712)
  1. Epic project!
  2. Uh...The furret in your pfp is hidden by the hacker badge.
RayhanADev (2594)

@FlaminHotValdez
1. Awesome, thanks!
2. Ya :/, wish I could do something about it but I have haxer till october :>

Bookie0 (6360)

oh my god look at these typos! xD



lol really, as you tend to say it, kewl!

I made an island. :)

edit: actually that's 2 islands! :)

RayhanADev (2594)

@Bookie0 lol i guss my gammar is just thath bad xD

also kewl

noice islands

Bookie0 (6360)

@RayhanADev hoh i unredstand yuo (:
yes islands xD

DynamicSquid (5022)

Awesome! Did you use a physics engine?

RayhanADev (2594)

@DynamicSquid thank you! and nope :), I just used some really simple math and random number generation, but the physics looks mildly realistic because of the small scale of the project!

DynamicSquid (5022)

@RayhanADev Nice! How did you do the collisions with the walls?

RayhanADev (2594)

@DynamicSquid the abridged version is I iterate through an array containing all the particles and check if the x/y points match up and stop it's descent. It gets a little more complicated on edge cases since at that point I have it randomly hop some distance to simulate the sand falling on the edges ;D. The one problem with my setup is the array can get huge and like someone mentioned it can get awfully laggy after some time but that's a-okay with me XD.

DynamicSquid (5022)

@RayhanADev Oh nice! Thanks for the explanation :)

RayhanADev (2594)

@DynamicSquid no problem :D, I'm actually happy that someone wants to know how it actually works lol

DynamicSquid (5022)

@RayhanADev This is random but you're Github page is actually really cool lol

RayhanADev (2594)

@DynamicSquid oh that, thank you :) I spent something like a 100 commits to make it look perfect definitely not a perfectionist here

MadMath123 (343)

@RayhanADev If you think about it, a rectangle like that is really 4 slopes.

kwe (57)

i love these sandbox type of games!

RayhanADev (2594)

@kwe YAY glad you like it :D

xXToluwaXx (72)

My ocean

was destroyed

till it died

the one piece of sand XD pogchamp

RayhanADev (2594)

@xXToluwaXx wow, what a pogchamp indeed
now that's actually funny ngl xD

27whuang (2)

So this is how god made earth huh

Whippingdot (678)

is this how fisics works?

TRIPPY

Finally can you make a cool pfp for me too? The only thing is I have to be a black (racism) dot with MLG glasses on. Oh and if you want to join the MLG gang ( @Codemonkey51 & @ch1ck3n ) add MLG glasses to ur pfp.

Whippingdot (678)

Oh an you can substitute glue with water

@Whippingdot

RayhanADev (2594)

@Whippingdot
1. The physics in this game is crappy xD, I didn't put enough effort into it clearly
2. Just follow the TikTok tutorials :). Go to https://picrew.me/ and make your own. The site is Japanese but you might understand enough of it.
3. Hmmm, i may consider it lol

ch1ck3n (2340)

@Whippingdot i have mlg glasses on my pfp

Whippingdot (678)

i know i mentioned both of you cause both of you are in the MLG gang with me. Codemonkey founded it @ch1ck3n

ch1ck3n (2340)

@Whippingdot cool
i hereby accept your invitation to the mlg gang

svensk007 (58)

Cool project but the water doesn't have any inertia(neither does the sand but that's less noticeable)... Still epic though.

RayhanADev (2594)

@svensk007 thanks!, and yeah they don't this was really just a basic hack I didn't spend any huge amount of time trying to code in physics

svensk007 (58)

@RayhanADev xD I'm not gonna look in the code and I don't know JS but as far as physics goes I don't think any physics sims are happening. I just see the particles going straight down from wherever they are because the ramps are well, ramps and the particles would slide. The only thing being calculated is collisions I think, but correct me if I'm wrong.

RayhanADev (2594)

@svensk007 you're not :) I never mention any physics (I think) and I actually said I don't use a physics engine on this project just some math and rng. I looks mildly realistic because of the smaller scale of the project, but it's just sand falling.

svensk007 (58)

@RayhanADev yeah I said I didn't think any physics simulations were happening

AstrumDeorum (162)

I love how the game gets rapidly slower as you go.
Also, Physics aren't real lmao

AstrumDeorum (162)

@RayhanADev Maybe make Water have no Sand collision, but Sand have Water collision.
So when water hits sand, the water isn't affected, but the sands like "Oh pardon you, I'm in the way."

RayhanADev (2594)

Super Satisfying 0w0!