miaoda-game-phaser-plugin
v0.3.0
Published
Small Phaser 4 Scene Plugin foundation for owning modular miaoda-game adapter instances.
Maintainers
Readme
miaoda-game-phaser-plugin
Shared lifecycle foundation for miaoda-game-*-phaser Scene Plugins. Most games should install the mechanic adapter directly; use this package only when building a custom Phaser plugin that owns disposable controllers.
pnpm add miaoda-game-phaser-plugin phaserclass CustomPlugin extends OwnedScenePlugin {
createController() {
return this.own(new CustomController(this.sceneHost));
}
}own(instance) registers an adapter for automatic destruction on Scene shutdown. release(instance) performs optional early cleanup. Registration during shutdown cleanup is rejected and the incoming adapter is immediately destroyed, so reentrant factories cannot leak resources into an inactive Scene. Final plugin destruction permanently closes ownership, while a normal Scene restart accepts a new generation after shutdown cleanup. This package manages ownership only; it does not change any core mechanic or gameplay state.
