There are a variety of demos in this directory, which aim to show you how to integrate box2d-wasm
into your application.
A directory of Node.js examples — for more highly-specialized use-cases (such as calculating physics server-side).
Demonstrates how to install box2d-wasm
into a plain old webpage.
No build system, no UI framework, no TypeScript, no ES modules. Just npm.
Imports Box2D.js via tag-loading (<script src="Box2D.js" />
).
This is a similar approach to that used in the box2d.js
repository.
Uses JSDoc comments to give you the benefit of the TypeScript typings, without needing to actually write or build TypeScript.
Demonstrates how to install box2d-wasm
into a plain old webpage.
No build system, no UI framework, no TypeScript. Just npm.
Imports your code as an ES module (<script src="demo.js" type="module" />
).
Imports Box2D.js via ES import (import Box2DFactory from 'box2d-wasm';
).
Uses JSDoc comments to give you the benefit of the TypeScript typings, without needing to actually write or build TypeScript.
Rollup build system, Svelte as UI framework, TypeScript.
Imports Box2D.js via ES import (import Box2DFactory from 'box2d-wasm';
).