Product
Introducing License Enforcement in Socket
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Planck.js is JavaScript rewrite of Box2D physics engine for cross-platform HTML5 game development.
Planck.js includes Box2D algorithms without modification and its architecture is very similar to Box2D. However some internal changes and refactoring are made during rewrite to address differences between C++ and JavaScript.
Planck.js public API closely follows Box2D API, with the following differences:
b2
prefix is dropped from class names, for example b2World
is now available as planck.World
.{}
).World#on(eventName, listenerFn)
and World#off(eventName, listenerFn)
are added to add and remove event listeners. Currently supported events are:
'begin-contact'
, 'end-contact'
, 'pre-solve'
, 'post-solve'
, 'remove-joint'
, 'remove-fixture'
, 'remove-body'
Package name for v0.3 is planck-js
.
The library is available on jsDelivr.
Install NPM package.
npm install planck-js --save
Use core library.
const planck = require('planck-js');
Use CDN in a web page.
<html><body>
<script src="//cdn.jsdelivr.net/npm/planck-js@latest/dist/planck-with-testbed.min.js"></script>
<script>
planck.testbed(function(testbed) {
// Your testbed code
});
</script>
</body></html>
Use NPM package in Node.
const planck = require('planck-js/dist/planck-with-testbed');
planck.testbed(function() {
// ...
});
Staring from v1.0 package name is changed to planck
.
To install v1.0 see master branch.
Box2D is a popular C++ 2D rigid-body physics engine created by Erin Catto. Box2D is used in several popular games, such as Angry Birds, Limbo and Crayon Physics, as well as game development tools and libraries such as Apple's SpriteKit.
Planck.js is developed and maintained by Ali Shakiba.
TypeScript definitions for planck.js are developed by Oliver Zell.
Planck.js is available under the MIT license.
FAQs
2D JavaScript physics engine for cross-platform HTML5 game development
The npm package planck-js receives a total of 440 weekly downloads. As such, planck-js popularity was classified as not popular.
We found that planck-js demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Product
We're launching a new set of license analysis and compliance features for analyzing, managing, and complying with licenses across a range of supported languages and ecosystems.
Product
We're excited to introduce Socket Optimize, a powerful CLI command to secure open source dependencies with tested, optimized package overrides.