Each plugin has its own folder. Plugins consist of four files:
- common.js - this is prepended to both edittime.js and runtime.js in case you have code common to both.
- edittime.js - defines the plugin for the editor, including all its actions, conditions and expressions.
- runtime.js - defines the plugin functionality in the browser.
- PluginIcon.ico - the editor loads this icon to represent the plugin.
A template for both a plugin and behavior can be downloaded here. You can copy these to a folder in the above directories to provide a skeleton starting point for your plugin or behavior.
Plugins work identically in the 32-bit and 64-bit versions of Construct 2.
All the "built-in" plugins and behaviors are also written this way. It would be useful to read their scripts - also in the above directories - to see how their features are implemented. You can learn a lot from this.
<install path>\exporters\html5. They are perfectly readable and commented (not minified). This is a great way to learn even more, but may make for some heavy reading. You may find these three scripts particularly relevant, though:
- common_prelude.js - prepended to both edittime scripts and runtime scripts.
- edittime_prelude.js - prepended only to edittime scripts.
- preview_prelude.js - prepended only to runtime scripts.