Open
Description
Describe the bug
Loving the project so far, thanks for keeping it up to date. I may be missing something but it seems plugins are not working for now -
Using the following code -
require("@geckos.io/phaser-on-nodejs");
import Phaser from "phaser";
import PhaserMatterCollisionPlugin from "phaser-matter-collision-plugin";
// @ts-ignore
import { phaserGameConfig, serverFPS } from "../../../common/config/phaserConfig";
global.phaserOnNodeFPS = serverFPS; // default is 60
// prepare the config for Phaser
const config = {
...phaserGameConfig,
type: Phaser.HEADLESS,
audio: false,
fps: {
target: serverFPS,
forceSetTimeOut: true,
},
plugins: {
scene: [
{
plugin: PhaserMatterCollisionPlugin, // The plugin class
key: "matterCollision", // Where to store in Scene.Systems, e.g. scene.sys.matterCollision
mapping: "matterCollision" // Where to store in the Scene, e.g. scene.matterCollision
}
]
}
};
export default config;
I then use in the scene as such -
//@ts-ignore
console.log(this.scene.matterCollision);
//@ts-ignore
this.scene.matterCollision.addOnCollideActive({
objectA: bot,
objectB: [Object.entries(this.playerSystem.playerGraphics)],
callback: ({ gameObjectA, gameObjectB }: any) => {
console.log("COLLISSSION ALLLEEERRTTTT");
},
});
However review the following error -
Metadata
Metadata
Assignees
Labels
No labels