explaingit

wellcaffeinated/physicsjs

Analysis updated 2026-07-03

3,699JavaScriptAudience · developerComplexity · 2/5LicenseSetup · easy

TLDR

An archived, modular JavaScript physics library for adding realistic collisions, gravity, and motion to browser games and animations, no longer maintained, with Matter.js recommended instead.

Mindmap

mindmap
  root((PhysicsJS))
    What it does
      Browser physics simulation
      Collision detection
      Gravity and motion
    Design
      Modular architecture
      Load only what you need
      Plugin-based extension
    Tech stack
      JavaScript
      Grunt build tool
    Status
      Archived, unmaintained
      Matter.js recommended
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Study how a modular browser physics engine is structured by reading the PhysicsJS source code before forking it.

USE CASE 2

Add gravity, bouncing, and collision detection to a browser-based game using the pre-built files in the dist directory.

USE CASE 3

Use PhysicsJS as a reference for understanding how to build a plugin-based JavaScript library architecture.

USE CASE 4

Create interactive browser animations where objects fall and collide realistically without a full game engine.

What is it built with?

JavaScriptGrunt

How does it compare?

wellcaffeinated/physicsjstechxuexi/techxuexi-jstoddmotto/echo
Stars3,6993,6983,698
LanguageJavaScriptJavaScriptJavaScript
Setup difficultyeasyeasyeasy
Complexity2/51/51/5
Audiencedevelopergeneraldeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 30min

Project is unmaintained since beta 0.7.0, pre-built files are in the dist directory so you can use it without building from source.

MIT license, use freely in personal or commercial projects, just keep the copyright notice.

In plain English

PhysicsJS is a JavaScript library for simulating physical interactions in a web browser. It was designed to be modular and easy to extend, meaning you can include only the parts you need rather than loading an entire monolithic library. Common use cases include browser-based games or interactive animations that need objects to fall, bounce, collide, or follow realistic motion. The library reached version 0.7.0 in beta before the author stopped active development. The README is upfront that this project is no longer maintained, and it points readers toward Matter.js as a more actively developed alternative that covers the same ground and more. For anyone who still wants to use PhysicsJS, the built distribution files are in the repository's dist directory, and the project's website provided installation and usage instructions. The source files are in the src directory, and building from source required Grunt, a JavaScript build tool. Running Grunt compiles the source and runs unit tests, a watch mode was available to rebuild automatically as you edited files. The project is licensed under the MIT license, so it can be used freely in commercial and personal projects. It was created by Jasper Palfree and is no longer accepting active contributions, though the code remains available for anyone who wants to fork it or study how a modular physics engine for the browser can be structured. Given its unmaintained status, new projects would generally be better served by a library that is still receiving updates.

Copy-paste prompts

Prompt 1
Using wellcaffeinated/physicsjs, write me a minimal browser example where a ball falls under gravity and bounces off the floor.
Prompt 2
How is PhysicsJS structured as a modular library? Walk me through how its plugin system works so I can understand how to build something similar.
Prompt 3
I want to add collision detection between two shapes in PhysicsJS, show me the minimum setup needed in a browser environment.
Prompt 4
Compare PhysicsJS and Matter.js for a browser game project, what does each offer and when would I still choose PhysicsJS?
Prompt 5
How do I build PhysicsJS from source using Grunt? Walk me through the steps to compile and run the unit tests.

Frequently asked questions

What is physicsjs?

An archived, modular JavaScript physics library for adding realistic collisions, gravity, and motion to browser games and animations, no longer maintained, with Matter.js recommended instead.

What language is physicsjs written in?

Mainly JavaScript. The stack also includes JavaScript, Grunt.

What license does physicsjs use?

MIT license, use freely in personal or commercial projects, just keep the copyright notice.

How hard is physicsjs to set up?

Setup difficulty is rated easy, with roughly 30min to a first successful run.

Who is physicsjs for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Scan in gitsafehub Deploy in gitdeployhub wellcaffeinated on gitmyhub

Verify against the repo before relying on details.