//
//  Caterpillar.h
//  Caterpillar
//
//  Created by Brandon Trebitowski on 11/15/11.
//  Copyright (c) 2011 __MyCompanyName__. All rights reserved.
//

#import "cocos2d.h"
#import "GameObject.h"

@class Segment;
// 1
typedef enum {
    CSRight,
    CSLeft,
    CSUpLeft,
    CSUpRight,
    CSDownLeft,
    CSDownRight
} CaterpillarState;

@interface Caterpillar : GameObject
// 2
@property (nonatomic, retain) NSMutableArray *segments;
// 3
@property (nonatomic, assign) CaterpillarState currentState;
@property (nonatomic, assign) CaterpillarState previousState;
// 4
@property (nonatomic, assign) ccTime totalTime;
@property (nonatomic, assign) NSInteger moveCount;
@property (nonatomic, assign) NSInteger level;

// 5
- (id)initWithGameLayer:(GameLayer *)layer level:(NSInteger)level position:(CGPoint) position;
// 6
- (void)update:(ccTime)dt;

@end
