Setting cocos2D camera position using CCFollow


/ Published in: Objective C
Save to your folder(s)

Use this variation of **setPlayerPosition** in your HelloWorldScene.m file to negate the need to use **setViewpointCenter** to manually calculate the viewport to track your player. This uses the **CCFollow** function as demonstrated in ActionsTest, one of the test apps included with cocos2D. Also to note is that the player movement is controlled by **CCMoveTo** which gives the player the same smooth movement around the map that the enemies have.

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.