Skip to content

I have replaced Arcade Physics with Box2D-WASM in the examples in the "Making Your First Phaser 3 Game" tutorial.

Notifications You must be signed in to change notification settings

8Observer8/port-to-box2dwasm-of-making-your-first-game-rollup-phaser3-js

Repository files navigation

I have replaced Arcade Physics with Box2D-WASM in the examples of the Making your first Phaser 3 game tutorial

Topic on the Phaser forum

Playground:

image

Instructions for building and running the project in debug and release:

  • Download and unzip this repository

  • Open the command line terminal and go to the lesson folder

  • Install the next packages globally with the command:

npm i -g http-server rollup uglify-js

  • Add the Rollup bin folder to the Path. Type this command to know where npm was installed npm config get prefix. This command will show you the npm location. You will find the "node_modules" folder there. Go to the "rollup\dist\bin" folder and copy this path, for example for me: C:\Users\8Observer8\AppData\Roaming\npm\node_modules\rollup\dist\bin. Add this folder to the path variable.

  • Run http-server in the project directory:

http-server -c-1

Note. The -c-1 key allows you to disable caching.

  • Start development mode with the following command:

npm run dev

Note. Rollup will automatically keep track of saving changes to files and build a new index.js file ready for debugging. You can debug your project step by step in the browser by setting breakpoints.

  • Go to the browser and type the address: localhost:8080/index.html

  • Create a compressed file ready for publishing. Stop development mode, for example, with this command Ctrl + C in CMD, if it was launched before and enter the command:

npm run release

Note. After this command, Rollup will create a compressed index.js file. Compression is done using the uglify-js package.

If you want to thank me: https://8observer8.github.io/donate.html

About

I have replaced Arcade Physics with Box2D-WASM in the examples in the "Making Your First Phaser 3 Game" tutorial.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published