Cocos2d – moving a sprite towards another sprite or a point

As I was working on a game in Cocos2d, a part of the game plan was that a sprite was chasing another sprite moved by the user. I implemented the method below in the “chaser” sprite so it would move towards the user’s sprite position which is passed as the point parameter.

Related Post

Remember to share...Share on FacebookTweet about this on TwitterShare on Google+Share on LinkedInEmail this to someone

4 thoughts on “Cocos2d – moving a sprite towards another sprite or a point

  1. Hi
    I am not sure how to implement the code to move a sprite towards another sprite. Would you mind posting or sending source code to help me understand it?
    Thanks
    David

Leave a Reply

Your email address will not be published. Required fields are marked *