all.CCMoveTo는 내 CCSprites에 영향을주지 않습니다.
-(void)tetrisL:(ccTime)dt {
Tetris *s = [[Tetris node]initWithArraySize:4];
[s createL];
for (CCSprite *new in s.tetrisArray) {
[self addChild:new];
id actionMove = [CCMoveTo actionWithDuration:3 position:ccp(new.position.x,0)];
[new runAction: actionMove];
}
[s release];
}
을하지만 그것은 작동하지 않습니다이다 : 나는 테트리스를 이동하려면이 기능의 일부 기능 "tetrisl"가 아래로 스프라이트. 동일한 액션에서 다른 스프라이트를 이동하려고하기 때문에 생각합니다. 어떻게 해결할 수 있습니까? 여기
감사
는 다른 스프라이트 한 조치를 할당 할 수 없습니다 테트리스 클래스@interface Tetris : CCNode {
NSMutableArray *tetrisArray;
Blocks *tempBlock;
}
@property (nonatomic, retain) NSMutableArray *tetrisArray;
@property (nonatomic, retain) Blocks *tempBlock;
-(id)initWithArraySize:(int)sz;
-(void)createL;
@implementation Tetris
@synthesize tetrisArray;
@synthesize tempBlock;
-(id)initWithArraySize:(int)sz {
if((self=[super init])) {
tetrisArray = [[NSMutableArray alloc]initWithCapacity:sz];
}
return self;
}
-(void)createL {
int xPos = 10;
int yPos = 460;
for (int i = 0; i < 4; i++) {
tempBlock = [[Blocks node]initWithType:1];
tempBlock.blockSprite.position = ccp(xPos,yPos);
[tetrisArray addObject:tempBlock.blockSprite];
xPos = xPos + 26;
[tempBlock release];
}
}
-(void)dealloc {
[tempBlock release];
[tetrisArray release];
[super dealloc];
}
다른 ? 스프라이트가 장면에 추가되지 않습니까? 나타나지만 이동하지 않습니까? – mbehan
예, 나타나지만 움직이지 않습니다. –
테트리스 클래스와 createL 메소드에 대한 자세한 정보를 제공 할 수 있습니까? – KDaker