Skip to content

Latest commit

 

History

History

modern

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

Demo (modern)

This package shows how you could install box2d-wasm into a modern webpage. This uses <script type="module" /> to consume the ES module distribution of Box2D.

Setup

Grab yourself a copy of this repository, install the demo's dependencies with npm:

git clone https://github.com/Birch-san/box2d-wasm.git
cd box2d-wasm/demo/modern
npm ci

Setup

Copy the ES module distribution of Box2D into the public folder (where the demo will be served from), and rename the copied folder to Box2D:

cp -R node_modules/box2d-wasm/dist/es public
mv public/es public/Box2D

Run

Serve the web application:

npm start

Navigate to localhost:5000.