On Sun, Nov 29, 2015 at 11:15 AM, Netanel M. <[email protected]>
wrote:

> Wow, thank you so much, that worked perfectly.
>

...


> You used the InstantAction class from cocos.actions.base_actions.
> But you treated it as a template, concatenating other actions into it
> using the sequence operator "+".
> But I hadn't thought of InstantAction and IntervalAction as containers but
> as bases for independent actions like "MoveTo"
>
>
Ummm... maybe you are distracted by incidental aspects ?
Just to clarify,

  - To 'add many' in a loop, I needed an accumulator (so I can write
     acc += element )
  - An initial value of DoNothing action for the accumulator seems adequate
  - Incidentally, InstantAction behaves as a DoNothing, so lets use it.

  - I used the varname template_action in the same sense as used in the
cocos docs, which wants to distinguish two distinct roles for Action
instances:

        worker_action = cocosnode.do(template_action)

worker_action is a copy of template_action; it's step method will be called
to perform the desired changes
template_action holds the complete description of desired changes.

Why not let template_action perform directly the changes ?
To allow things like
    template_action = MoveTo((100, 100), 2)
    blue_monster.do(template_action)
    sleep(2)
    red_monster.do(template_action)

-- 
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/d/optout.

Reply via email to