Hello,
I would like to chain some actions for multiple targets. Say I want to do a
little animation with two sprites:
1. Sprite1 moves next to Sprite2 in 5 sec.
2. Sprite1 says: "Where should I go?" for 3 sec.
3. Sprite2 says: "Go to the bottom right corner." for 3 sec.
4. Sprite 1 moves to the bottom right corner in 5 sec.
And let's just assume there is an action to say something (not relevant for
what I'm trying to figure out).
How would be the best way to put that in place? I can sequence the first
two actions. But how to know when Sprite2 should start saying something? To
me this feels like actions should emit an event "action_stopped". Is this
the right way to go?
Another idea is to have a parent action which is aware of the sequence of
actions and the sequence of targets involved. It would check in each update
if the current action if finished, and if so, pass to the next action
applying the correct target. But then again not too sure how to go down
this route.
I tried sequencing with CallFunc passing a function for the next action (
Sprite2.do(Say("blahblah", 3)) ), but obviously when Sprite2 starts the
action #3, Sprite1 starts immediately action #4.
Any suggestion to a good way to implement this would be highly appreciated.
Best regards,
Daniel.
--
You received this message because you are subscribed to the Google Groups
"cocos2d discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/cocos-discuss.
For more options, visit https://groups.google.com/groups/opt_out.