HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
schteppe
p2.js
JavaScript2013–2018
schteppe / p2.js

p2.js

JavaScript 2D physics library

6Distinct people
6Mentions
0Explicit recommenders
2.7KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

JavaScript 2D physics library

GitHub

Where it is used

No documented product use has been verified yet.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 3:56:07 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year6 dated mentions

Observed mentions: 2013-10-23 22:08:08 UTC to 2018-12-28 19:09:51 UTC.

0122013-01-01 00:00:00 UTC to 2014-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments20132014-01-01 00:00:00 UTC to 2015-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2015-01-01 00:00:00 UTC to 2016-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments20152016-01-01 00:00:00 UTC to 2017-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2017-01-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments2018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments2018

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20132013-01-01 00:00:00 UTC2014-01-01 00:00:00 UTC101
20142014-01-01 00:00:00 UTC2015-01-01 00:00:00 UTC000
20152015-01-01 00:00:00 UTC2016-01-01 00:00:00 UTC101
20162016-01-01 00:00:00 UTC2017-01-01 00:00:00 UTC000
20172017-01-01 00:00:00 UTC2018-01-01 00:00:00 UTC202
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC202

What Hacker News says

6 sources
Great point. This is why I used p2.js for javascript game physics over franken-emscripten Box2d ports. The readme and source code are extremely accessible (https://github.com/schteppe/p2.js#sample-code). When I was trying to optimize my collision detection, I stepped in to p2.js source to read narrowphase vs broadphase implementations. Last I used Box2d, I was reading c++ pdf documentation.
In Brain.js
If you're targeting the web, then you're compiling to Javascript anyways, so the indirection + engine complexity isn't always worth it. Unity tends to pay off as you take on more platform targets and/or implementation complexity (like graphics), for example. It's kinda like using https://github.com/schteppe/p2.js for physics instead of Box2D: if p2 gets the job done, then you get the advantage of working with a much simpler code base than Box2D which is just about impenetrable as an emscripten port.
In Impact – HTML5 Game Engine
Why is this upvoted so much? In what way is it better than any of the existing JS physics engines? Matter.js: http://brm.io/matter-js/ Cannon.js: http://www.cannonjs.org/ PhysicsJS: http://wellcaffeinated.net/PhysicsJS/ Box2DJS: http://box2d-js.sourceforge.net/ (Emscripten-compiled from flash) p2: https://github.com/schteppe/p2.js Ammo.js: https://github.com/kripken/ammo.js/ (Emscripten-compiled from C++) JPE: https://github.com/colorhook/JPE Oimo.js: https://github.com/lo-th/Oimo.js/ Planck.js: https://github.com/shakiba/planck.js
In Show HN: A 2D Physics Simulator in JavaScript
I am familiar with P2 JS, looked through PhysicsJS and the two very basic arcade engines grown within Phaser JS. Matter JS seems to have the exact same feature set like any other library. I haven't seen any 2D web engine, besides the JS ports of Box2D, which supports continuous collision detection (CCD), which would prevent a lot of tunneling, especially on slower mobile phones. Why is that? CCD doesn't look more complex in theory than any other concept in a 2d physics engine. P2JS: https://github.com/schteppe/p2.js PhysicsJS: http://wellcaffeinated.net/PhysicsJS/ Phaser: http://phaser.io/
In Matter.js – A 2D rigid body physics engine for the web

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.