Note that here
Since IInstance has a
runtime property, within your class you can always use
this.runtime to refer to the runtime script interface.
use your custom features
Now whenever you retrieve instances of the player from the existing APIs, you'll get
PlayerInstance classes instead of the default
ISpriteInstance. Then you can read your custom properties and call custom methods.
// Assume called in "beforelayoutstart" event
// Get player instance from Construct
const playerInstance = runtime.objects.Player.getFirstInstance();
// Example uses of custom class
console.log("Ammo = " + playerInstance.ammo);
Construct 3 Manual