cocos2d(CCSprite绑定不规则刚体与精灵一起移动)
来源:未知 责任编辑:责任编辑 发表时间:2014-04-20 03:36 点击:次
	   
	对于不规则的精灵我们可以借助PhysicsEditor来制作shape ,
对于地图可以使用Tiled软件制作瓷砖地图。
今天主要记录一下如何把CCSprite与不规则刚体进行绑定,然后一起移动
//初始化玩家
1.加载shape文件,在init方法中添加:
//加载shape文件
        [[GB2ShapeCache sharedShapeCache] addShapesWithFile:@"physicShape.plist"];.plist文件内容大体如下:
metadata format 1 ptm_ratio 32 bodies Player1 anchorpoint { 0.0000,0.0000 } fixtures density 2 friction 0 restitution 0 filter_categoryBits 1 filter_groupIndex 0 filter_maskBits 65535 isSensor id fixture_type POLYGON polygons { 1.000,0.000 } { 32.000,0.000 } { 27.000,32.000 } { 7.000,32.000 } RetroCoin anchorpoint { 0.0000,0.0000 } fixtures density 2 friction 0 restitution 0 filter_categoryBits 1 filter_groupIndex 0 filter_maskBits 65535 isSensor id fixture_type POLYGON polygons { 4.000,3.000 } { 17.000,0.000 } { 28.000,3.000 } { 28.000,28.000 } { 16.000,32.000 } { 4.000,28.000 } 
相关新闻>>
最新推荐更多>>>
              
          - 发表评论
- 
				
- 最新评论 进入详细评论页>>

![cocos2d_x+lua[2]](/uploads/allimg/131030/110J64609-0-lp.jpg)








