Cocos2d iphone 地图下的精灵

Cocos2d iphone 地图下的精灵,cocos2d-iphone,Cocos2d Iphone,你好,我有一些雪碧和一些地图 -(id)init { if((self=[super init])){ self.tiledMap=[CCTMXTiledMap tiledMap withtmxfile:@“map3.tmx”]; self.background=[[地图图层名称:@“background”]; [self.tileMap运行动作:[CCMoveBy动作持续时间:10.0位置:ccp(0,-2750)]; [[CCSpriteFrameCache sharedSpriteFram

你好,我有一些雪碧和一些地图

-(id)init {

if((self=[super init])){
self.tiledMap=[CCTMXTiledMap tiledMap withtmxfile:@“map3.tmx”];
self.background=[[地图图层名称:@“background”];
[self.tileMap运行动作:[CCMoveBy动作持续时间:10.0位置:ccp(0,-2750)];
[[CCSpriteFrameCache sharedSpriteFrameCache]addSpriteFramesWithFile:@“AnimBear.plist”];
CCSpriteBatchNode*spriteSheet=[CCSpriteBatchNode batchNodeWithFile:@“AnimBear.png”];
[自添加子项:精灵表];
NSMutableArray*walkAnimFrames=[NSMutableArray];

对于(int i=1;i问题在于,ure缺少z值,这说明了材料的顺序

[spriteSheet addChild:_bug z:2];
[self addChild:_map z:1];
图层使用zOrder组织前面或后面的对象值越低,距离屏幕越远

[spriteSheet addChild:_bug z:2];
[self addChild:_map z:1];