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

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

GitHub repository with Rollup guide

Playground:

image

1 Like

Demo on Glitch + source code: Box2D-WASM physics on the server side with Phaser 3 and JavaScript

box2dwasm-physics-on-the-server-side-with-phaser3-js

The server sends the positions of the collider vertices that Phaser draws:

image

Some progress with multiplayer. I send the collider vertices and rays from the server with Box2D-WASM to clients if the “Show debug info” is checked:

image

The ray casting with Box2D-WASM is necessary to check if the player is on the ground to make a jump.

Demo: https://walk-and-jump-with-multiplayer-box2dwasm-phaser3-js.glitch.me/

GitHub repository

Server and client sources on free Glitch hosting

walk-and-jump-with-multiplayer-box2dwasm-phaser3-js

Port of the official “Making your first Phaser 3 game” tutorial examples to multiplayer with Box2D-WASM on the server side