Control:function(){
this._moveAction = cc.MoveBy.create(0.5, new cc.Point(50,50));
// var action1 = cc.CallFunc.create(this,this.sprite2.runAction(cc.MoveBy.create(0.5, new cc.Point(50,50)))); Wrong1! sprite1 and sprite2 move simultaneously, why?
var action1 = cc.CallFunc.create(this,this.callback);
var action = cc.Sequence.create(
this._moveAction,
action1
)
this.sprite1.runAction(action);
},
callback:function () {
// this.sprite2.runAction(this._moveAction); Wrong2! Sprite2 won’t move, why?
this.sprite2.runAction(cc.MoveBy.create(0.5, new cc.Point(50,50)));
}
Those codes execute successfully. I tried many times to make it work. Some codes seem to be right but in face they are wrong, like Wrong1 and Wrong2, why?
I want the sprites to execute action one by one, perhaps it would be looked like this:
var xx = cc.Sequence.create(this.sprite1.runAction(action), this.sprite2.runAction(action2),…)
this.runAction(xx);
is it possible? if so, it would be very convenient.