💎 5 Cool JavaScript Physics Libraries 🤓
Tags: webdev, javascript, programming, beginners
Published: 2023-12-19 14:20:09



![welcome](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/geapwnhve30sxk2x2ivj.gif)


 

**Yesterday** i was doing some research on cool physics libraries that can be used in JavaScript games and websites. Here are my top 5 picks with a little intro on each .

And Don't Forget to Drop a "🔥💖🦄🚀" and Save it ✅.

Let's Begin with 👇

---

## 1. [Box2D](https://box2d.org/) 🥊


![box2d](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j0knez36vo304nfguqtc.jpeg)

{% cta https://box2d.org/ %}Chekout 👆{% endcta %}

**Box2D is super popular for 2D physics!** 

It was made for games and is really fast and accurate. The website looks so professional. 
It has great documentation and tutorials to help understand how to use it.

Some big games like **Angry Birds** use it!

---

## 2. [Matter.js](https://brm.io/matter-js/) 🧪


![mattejs](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bh5zbzngbay90y0wct31.jpeg)

{% cta https://brm.io/matter-js/ %}Chekout 👆{% endcta %}

This one also does **2D rigid body physics** and looks like it would be beginner friendly. 

The demos on the website are really fun to play with. It supports things like compound bodies which are really useful. 
And the **API documentation** seems easy to navigate. 

This would be great for prototyping game ideas!

---

## 3. [LiquidFun](https://google.github.io/liquidfun/) 💧


![liquidFun](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zcsuw1ktfs0d6g3qocia.jpeg)

{% cta https://google.github.io/liquidfun/ %}Chekout 👆{% endcta %}

**LiquidFun is really cool because it can simulate fluids!** 

I think playing with liquids in games could lead to very creative levels. 
It's based on Box2D under the hood so it has great performance. And the examples on the site look so realistic. 

Definitely going to try building a water physics game with this!

---

## 4. [PhysicsJS](https://wellcaffeinated.net/PhysicsJS/) 🧬


![physicsJS](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8evndxyyetntee1q21g2.jpeg)

{% cta https://wellcaffeinated.net/PhysicsJS/ %}Chekout 👆{% endcta %}

**This one seems really flexible with a modular design.** 

The examples page has a nice variety of demos to test out. I love that it works with different renderers like PIXI.js so you're not locked into one.
 
PhysicsJS also has things like constraints which could allow for some puzzle elements in games.

---

## 5. [Oimo.js](https://lo-th.github.io/Oimo.js/#basic) 🧸


![oimojs](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2pm6tqhvc7wvj6vgvxfr.jpeg)

{% cta https://lo-th.github.io/Oimo.js/#basic %}Chekout 👆{% endcta %}

**Finally,Oimo.js is interesting because it aims to be very lightweight and simple to use.** 

The API docs have clear explanations. 
It's 3D capable too which opens up possibilities beyond just 2D. 
I think this could be good for mobile game prototypes where performance matters. 

The basic demo on their site is fun to mess around with sliders and see the physics in action.

---

## Devletter 📩

Devletter is a great weekly newsletter for all things tech. 
You'll get the **latest coding news and insights** to stay ahead of trends.
 
**Devletter** is a perfect way to learn about upcoming hackathons and events in your area too.

Make sure to Join Devletter now so you **never miss out** on amazing opportunities and discovery in the tech space.

{% cta https://devletter.vercel.app %}Join Devletter ✔{% endcta %}

---

## That's it 😅

All these libraries look awesome and would be so useful for building the games and 3d portfolios. 

These will definitely help when I start learning game development.

Now I just you need to decide which one to try out first😅 for my next coding project over summer break 🤔 

**Thanks for reading**



{% embed https://dev.to/random_ti %}

[![github](https://img.shields.io/badge/GitHub-100000?style=for-the-badge&logo=github&logoColor=white)](https://github.com/taqui-786) 

[![twitter](https://img.shields.io/badge/Twitter-1DA1F2?style=for-the-badge&logo=twitter&logoColor=white)](https://twitter.com/Taquiimam14)

[![portfolio](https://img.shields.io/badge/Portfolio-255E63?style=for-the-badge&logo=About.me&logoColor=white)](https://mdtaquiimam.vercel.app)

[![buymeacoffee](https://img.shields.io/badge/Buy_Me_A_Coffee-FFDD00?style=for-the-badge&logo=buy-me-a-coffee&logoColor=black)](https://www.buymeacoffee.com/taquiDevloper)