Looks like it doesn't work if inside a Family.
I've tried that, but changes don't seem to reflect. weird
You can pass query params into the game.
<iframe src="/game/index.html?someParam=someValue&anotherParam=anotherValue"></iframe>
Then inside the game Set someGlobal variable to those values Browser.QueryParam("someParam")
Browser.QueryParam("someParam")
Hello,
I have a function that creates an object
createObject(runtime.objects.Player) createObject(object) { const instance = object.createInstance( this.ABOVE_LAYER, this.W, this.H ); const { Bullet } = instance.behaviors; Bullet.speed = 100 Bullet.isEnabled = true; // todo, change the instance width. }
I would like to change the width of newly created instance., Looks like there is no `width` setter on the instance itself.
Any ideas?
Develop games in your browser. Powerful, performant & highly capable.
Found the solution
runtime.objects.Enemy1.createInstance(layer, x, y)
I am trying to use scripting to create an object.
runOnStartup( async runtime => { runtime.addEventListener('afterprojectstart', () => afterProjectStart(runtime)) }); function afterProjectStart(runtime) { const enemy1 = runtime.objects.Enemy1.getFirstInstance(); runtime.createInstance(enemy1, 2, 100, 100) }
I get runtime.createInstance is not a function
runtime.createInstance is not a function
Member since 18 Nov, 2019