Engine-agnostic
Physics & Collisions (Engine-Agnostic)
These patterns apply to any physics engine (Arcade Physics, Matter.js, Rapier, Cannon.js, etc.). For Phaser-specific APIs, see Phaser Physics & Input.
Core Principle
The most important rule for multiplayer physics is Host Authority:
- Host runs the simulation: The host calculates physics, collisions, and movement.
- Clients mirror the state: Clients receive positions/velocities and render them.
- Clients predict (optional): For smoother gameplay, clients can predict movement locally, but the host is always the source of truth.
Guides
- Phaser Physics & Input - Using Arcade Physics with Phaser