I have situation like this:
export default class attackInstance extends globalThis.InstanceType.attack { name: string; constructor( name: string, ) { super(); this.name = name; } }
runtime.objects.attack.setInstanceClass(attackInstance); ... const attack: attackInstance = runtime.objects.attack.createInstance(0,200, 200);
And what I want to pass arguments to constructor but I dont knew how or even if its posible.
Develop games in your browser. Powerful, performant & highly capable.
You can't pass custom arguments to the constructor when using subclassing. However you can just use an init() method that you call afterwards instead.
init()