1 decade ago by ethanklein
Hi. I have a level with multiple buttons and multiple doors.
I'm trying to code it such that when my player touches a button a door opens.
Each button controls a separate door.
I'm attempting to use 'target' and 'name' entity properties in weltmeister to link all the entities accordingly.
My problem is that the entity properties don't seem to be saving correctly in weltmeister.
I'm following the instructions found in 'manipulating entities' here:
http://impactjs.com/documentation/weltmeister
Also... i've able to successfully give names to my entities in the init() function of the button.js and door.js.
I can't figure out how to uniquely identify each instance of an entity in a level. Currently i'm using javascript's random number generator as a placeholder:
Am I missing something about saving entity properties in weltmeister. It looks easy but i get 'undefined' whenever attempting to print the name of an entity I've named in weltmeister.
Thanks!!!
I'm trying to code it such that when my player touches a button a door opens.
Each button controls a separate door.
I'm attempting to use 'target' and 'name' entity properties in weltmeister to link all the entities accordingly.
My problem is that the entity properties don't seem to be saving correctly in weltmeister.
I'm following the instructions found in 'manipulating entities' here:
http://impactjs.com/documentation/weltmeister
Also... i've able to successfully give names to my entities in the init() function of the button.js and door.js.
I can't figure out how to uniquely identify each instance of an entity in a level. Currently i'm using javascript's random number generator as a placeholder:
init: function( x, y, settings ) { this.parent( x, y, settings ); this.addAnim('on', .07, [0]); this.addAnim('off', .07, [1]); this.name = "switchOn" + Math.floor(Math.random() * (20 - 1 + 1) + 1); },
Am I missing something about saving entity properties in weltmeister. It looks easy but i get 'undefined' whenever attempting to print the name of an entity I've named in weltmeister.
Thanks!!!