hi noob here
I want to make my cylinder move step by step to the object on a board that i create,
I have this code :
a : the start
index : the objectf
attachEvent(_this, index,a) {
if(index>=a){
_this.domEvents.addEventListener(_this.cases[index], 'click', function(event) {
for ( var i = a; i <= index; i++) {
_this.stepByStep(_this,i)
}
}, false)
}else{
_this.domEvents.addEventListener(_this.cases[index], 'click', function(event) {
}, false)
}
}
stepByStep(_this,i)
{
_this.tween = new TWEEN.Tween(this.pions.position)
.to({
x: _this.cases[i].position.x,
y: _this.cases[i].position.y,
z: 5},1000)
.start();
}
but it don’t he go to case[index] whitout step by the other case