1

I've got three questions.>.<

  1. I have 2 actors(actor1,actor2), and an action(eg. ScaleTo). My willing is to make actor1 do the scaleTo firstly,and then(maybe after two seconds) actor2. Or randomly choose the actor to behave the action, and repeat the process n times.

  2. Are there any methods like squenceAction, but could be like this "sequence(Actor1.action,delay,Actor2.action,......)"

  3. Or is there be the timeline API which i can put the action of actor on several specific time points?

Jirachi
  • 23
  • 2

1 Answers1

1

not if be the more correct way, but it occurs to me that if I understand your question, you can put in your listener for example this:

Actor1.addAction(Actions.sequence(Actions.delay(0.1f),
                                 Actions.parallel(
                                 Actions.moveBy(0f, 600, 1f),
                                 Actions.fadeOut(0.8f))));

and in your render this one:

if (Actor1.getActions().size == 0) {

Actor2.addAction(Actions.sequence(Actions.delay(0.2f),
                                  Actions.parallel(
                                  Actions.moveBy(0f, 600, 1f),
                                  Actions.fadeOut(0.8f))));

//Actor1.addAction(Actions......add actions to the actor one again or
// whatever you can think is that it's not what you really want to do,
// but you can handle yourself with the method called from the if
}

depends what you want to do, I think it would be better that worked it how long the first actor to finish the action, before the 2 second for example, put it in the second actor two second delay, for start amimacion in second actor.

test: 0.2f + 1.8, not + fadeOut becouse is parallel

Actor1.addAction(Actions.sequence(Actions.delay(0.2f),
                                 Actions.parallel(
                                 Actions.moveBy(0f, 600, 1.8f),
                                 Actions.fadeOut(0.8f))));

add delay; 2.1f

Actor2.addAction(Actions.sequence(Actions.delay(2.1f),
                                  Actions.parallel(
                                  Actions.moveBy(0f, 600, 1f),
                                  Actions.fadeOut(0.8f))));

P.S: I hope you can understand what I say.

Angel Angel
  • 19,670
  • 29
  • 79
  • 105