Phaser 3 Debug Body Colors Plugin

new Phaser.Game({
  plugins: {
    scene: [
      {
        key: 'DebugBodyColorsPlugin',
        plugin: PhaserDebugBodyColorsPlugin,
        mapping: 'debugBodyColors'
      }
    ]
  },
  physics: {
    arcade: { debug: true }
  }
});

or

function preload () {
  this.load.scenePlugin('PhaserDebugBodyColorsPlugin', 'https://cdn.jsdelivr.net/npm/phaser-plugin-debug-body-colors@3.0.0');
}

Colors

  • disabled — gray
  • blocked, not disabled — red
  • touching, not disabled or blocked — yellow
  • embedded, not disabled, blocked or touching — aqua
  • not disabled, blocked, touching, or embedded — violet