Custom Class Static Group

Hey there, sorry I’m being too noob :sweat_smile:, you don’t understand how I have to create a class that extends from Phaser.Physics.Arcade.StaticGroup, and I’m also a little confused how to add GameObjects . Same one can help? :grin:

Until now this is what i have:

export default class Platforms extends Phaser.Physics.Arcade.StaticGroup {
    constructor(world, scene) {
        super(world, scene, ["platforms"]);
        this.create(0, 0, "platform");
    }
}

The game I’m developing: HomoGame - Phaser 3
The code: Mangito / HomoGame / Phaser-3-Arcade · GitLab

The third argument to super() must be either children or config.

1 Like

Humm, sorry, I think I don’t understand what you mean with should put the children :sweat_smile:.
Have any example?

(Thanks for answering)

The third argument, ["platforms"], is wrong. Remove it.

In the scene you need something like

const platformsGroup = new Platforms(this.physics.world, this);
1 Like

Very grateful, I already got :grin: