MDN self-hosted library · e01.org
Physics / notebook

Physics

Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.

js
const config = {
  // ...
  physics: {
    default: "arcade",
  },
};
js
this.physics.add.existing(this.ball);
js
this.ball.body.setVelocity(150, 150);
js
class ExampleScene extends Phaser.Scene {
  // ...
  update() {}
}