Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8521967
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T06:58:30+00:00 2026-06-11T06:58:30+00:00

I have found several post that teach how to use UIBezierPaths with CoreAnimation. This

  • 0

I have found several post that teach how to use UIBezierPaths with CoreAnimation. This works because CAKeyframeAnimation objects have a property called path that is of type CGPath and also UIBezierPaths objects have a CGPath property.

I am wondering how I could get a CCSprite to move following a CGPath.

In CGPath there is a function CGPathGetCurrentPoint that will help me getting the current point in a path but I couldn’t find something like “move to next point”.

My pseudocode would work like this:

Create a CCSprite subclass with a UIBezierPaths property
Initialize the UIBezierPaths instance

Allocate the CCSprite subclass in a layer
schedule updates
In update method
     Reposition the CCSprite sublcass instance by getting the CGPathGetCurrentPoint to CGPathGetCurrentPoint
     Move the path forward by calling "move to next point"

Any idea if this would work? Is this an effective approach?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T06:58:32+00:00Added an answer on June 11, 2026 at 6:58 am

    Not sure what you are trying to do, but this is how I move some sprite along bezier paths in Cocos2D:

    - (CCBezierTo*)bezierMoveTo:(CGPoint)destination node:(CCNode*)node duration:(float)d {
    
     static ccBezierConfig bzPaths[5] = {
        {{1050, 900}, {1200, 1400}, {1100, 900}},
        {{1100, 750}, {1300, 1550}, {1650, 500}},
        {{800, 850}, {500, 1100}, {400, 700}},
        {{700, 700}, {1500, 1200}, {400, 900}},
        {{900, 650}, {100, 900}, {900, 400}}
     };
     ccBezierConfig bezierOne;
     bezierOne = bzPaths[PATH_INDEX];
     return [CCBezierTo actionWithDuration:d bezier:bezierOne];
    }
    

    The returned action can be then run on a sprite. In my case, I have a set of static paths, and I choose one at random. In your case, it seems you would like to store the path within your custom sprite. Apart from that, everything should work.

    If you want to build more complex paths, simply use a sequence of ccBezierConfig and CCBezierBy.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have made this mistake several times, and found myself referencing This Post every
I've investigated several C# DLL's and have not found any that work especially well.
I've looked through several posts but I haven't quite found any answers that have
So I have an iPhone application that needs to: Post several strings and up
The sad truth about this post is that I have poor regex skills. I
I have read through Scott Hanselman's post on this topic. I found another article
Bear in mind, I have researched this and have found several articles, however, they
In my project, I have several models that use a number of scopes that
I have found several other questions here on S.O. (and the web in general)
I have found several guides on how to get a 3D animation to flip

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.