Create a Matter Sprite Class from a Phaser Container

I’m trying to create a Matter Sprite from a Phaser Container. This is pretty straightforward using this.matter.add.gameObject(phaserContainer), however I’d like to do it using its own class.

When calling super() on a Phaser.Physics.Matter.Sprite class, I am unable to pass in a Phaser Group as it only supports a single texture.

Below is my ideal outcome.

const player = new Player() // extends Phaser.Physics.Matter.Sprite

Inside this player is a Phaser Container of several different game objects.

:wave:

I would guess you do

class Player extends Phaser.GameObjects.Container {
  constructor (scene, x, y, children) {
    super(scene, x, y, children);
    
    scene.matter.add.gameObject(this);
  }
}