DEV Community

Zevan Rosser
Zevan Rosser

Posted on

1 3

Easy Gravity in 30 lines

Not sure why I felt like making this little example this morning. It's a very short bit of code that causes a div to move with gravity... while there is not much code, I made a point not to golf it (even though I was tempted).

If you want to learn more about how to move stuff like this, I have a pretty old tutorial I made that you can check out:

video is old, but basic concepts still work

Top comments (0)

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free →

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay