Another option is with the action CallFunc:

def after_wolf_move():
    sprites = (self.farmer, self.boat, self.wolf)
    for n in sprites:
        n.do( MoveBy((-350, 0), 1))

self.wolf.do(MoveTo((x, y + 10),5) + CallFunc(after_wolf_move))

The advantage is twofold:
    . it expresses more directly the idea "after this do that"
    . you don't need to remember to maintain the duration (5 in your
example) synchronized  in the two first lines of your code




On Mon, Mar 30, 2015 at 6:31 PM, Burak Köse <[email protected]> wrote:

> I have solved this way.
>
> self.wolf.do(MoveTo((x, y + 10),5))
> action = Delay(5)
>
> sprites = (self.farmer, self.boat,self.wolf)
> for n in sprites:
>     n.do(action + MoveBy((-350, 0), 1))
>
>
>
>
> 30 Mart 2015 Pazartesi 07:07:47 UTC+3 tarihinde Burak Köse yazdı:
>
>> I have a problem , here is http://stackoverflow.com/
>> questions/29322980/cocos2d-wait-for-action-to-finish-in-python
>>
>> self.wolf.do(MoveTo((x, y + 10)))
>>
>> sprites = (self.farmer, self.boat,self.wolf)
>> for n in sprites:
>>     n.do(MoveBy((-350, 0), 1))
>>
>>
>> I want to wait to finish wolf's action, before run on for loop.What can I
>> do?
>>
>  --
> 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.
>

-- 
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