Hi,

On Sat, Nov 28, 2015 at 9:01 AM, <[email protected]> wrote:

> Greetings,
>
> ...


> I want to ; player.do(MoveTo(coords_list, 1))
> Unfortunately it doesn't work like that.
> I'm pretty sure I can achieve this with CallFunc, but I'm not sure how.
>
>
a simple way to implement that can be

def action_follow_checkpoints(points):
    template_action = InstantAction()
    for p in points:
      template_action += MoveTo(p, 1)
    return template_action

player.do(action_follow_checkpoints(points))

This handles the displacement.

You probably want to also change the player heading.

Another approach is to define your own IntervalAction subclass
FollowCheckpoints: MoveTo interpolates a line between two points, Follow
Checkpoints should interpolate a polyline between two points

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