iPhone: Camera following player in cocos2d

前端 未结 2 1026
半阙折子戏
半阙折子戏 2021-02-03 16:21

I\'m making an iPhone game in cocos2d.

I was wondering how I would make the camera / the view follow a specific sprite?

would I use the CCCamera class?

2条回答
  •  北荒
    北荒 (楼主)
    2021-02-03 16:55

    use CCFollow actions

    Like these :-

    [self runAction:[CCFollow actionWithTarget:(u r hero) worldBoundary:CGRectMake(0,0,1050,350)]];
    

    it will helps

提交回复
热议问题