2012-12-17 2 views
-2

의 지정이나 규정되어 필요합니다.개체 CCSprite의 하위 클래스 I가 클래스를 건물입니다 오브젝트 C 클래스

오류가있는 곳에서 코드를 주석 처리했습니다. 나는 무엇을 잘못하고 있는지 확실하지 않습니다.

int tileSize = 80; 
Boolean moveable = true; 
id moveUp,moveRight,moveDown,moveLeft; 

@interface Player : CCSprite { 

//On these lines. 
moveUp = [CCMoveTo actionWithDuration:2 position:ccp(0, 0 - tileSize)]; 
moveDown = [CCMoveTo actionWithDuration:2 position:ccp(0,0+tileSize)]; 
moveRight = [CCMoveTo actionWithDuration:2 position:ccp(0+tileSize,0)]; 
moveLeft = [CCMoveTo actionWithDuration:2 position:ccp(0-tileSize,0)]; 


} 


-(void)move; 



@end 


@implementation Player{ 





@end 
+2

기본 사항에 익숙해지기 전까지는 Objective-C 코드의 다른 줄을 작성하지 않는 것이 좋습니다. – trudyscousin

답변

3

인터페이스에 코드를 넣을 수 없습니다. 메서드 또는 함수에 코드가 있어야합니다. 거기에 있어야하는 유일한 것들은 속성 목록입니다.

관련 문제