1 decade ago by Rungo73
I have an entity in WM called ladder that Im using multiple times in my level as an invisible entity over a ladder tile. When touched by the Player sets a flag onLadder to true.
Seems each copy of ladder in WM has an ID, so if I use it 3 times the IDS are 0, 1, 2. How can I set them all to be the same ID? or if not, how can I iterate through?
Heres the bit of code Im using thus far that works for a single instance of the ladder entity..
Seems each copy of ladder in WM has an ID, so if I use it 3 times the IDS are 0, 1, 2. How can I set them all to be the same ID? or if not, how can I iterate through?
Heres the bit of code Im using thus far that works for a single instance of the ladder entity..
var _ladder= ig.game.getEntitiesByType(EntityLadder)[0]; if(this.touches(_ladder)) if( this.onGround && ig.input.state("up") || !this.onGround && this.vel.x < 75 && this.vel.x >-75){ this.onLadder = true; } else{ this.onLadder = false;}}