0
0
Fork 0
mirror of https://github.com/liabru/matter-js.git synced 2025-01-31 18:14:55 -05:00

Updated Creating plugins (markdown)

Liam 2017-01-26 23:55:11 +00:00
parent 4d047bf8ad
commit 41e72da54b

@ -169,6 +169,7 @@ Some general guidelines for plugins:
- build plugins with sharing and reuse in mind
- don't store references to `Matter.*` functions (as they may reference unpatched versions)
- don't _add_ new functions to modules or namespaces you don't maintain (only patch existing functions)
- add custom properties to `obj.plugin` e.g. `body.plugin.newFeature.enabled`
- follow the same namespacing structure as the core (e.g. `MyPlugin.Body.init`, `MyPlugin.Engine.update`)
- expose and implement your plugin's functions so that they can be called manually
- avoid relying a particular order of execution where possible