All Data Structures Files Functions Variables Enumerations Enumerator Properties Defines
/Projects/Cogito/src/GameObjects/Lemming.h
Go to the documentation of this file.
00001 //
00002 //  Lemming.h
00003 //  Author: Thomas Taylor
00004 //
00005 //  Code for the lemming characters
00006 //
00007 //  21/11/2011: Created class
00008 //
00009 
00010 #import "GameObject.h"
00011 #import "LemmingManager.h"
00012 #import "Obstacle.h"
00013 #import "Terrain.h"
00014 #import "Utils.h"
00015 
00016 @interface Lemming : GameObject
00017 
00018 {
00019     int health;
00020     int respawns;                          
00021     int fallCounter;
00022     CCSpriteFrame* standingFrame;
00023     CharacterStates state; 
00024     Direction movementDirection;
00025     GameObjectType objectLastCollidedWith;  
00026     
00027     BOOL isUsingHelmet;
00028     int helmetUses;
00029     
00030     BOOL isUsingUmbrella;
00031     BOOL umbrellaEquipped;
00032     int umbrellaUses;
00033     int umbrellaTimer;
00034     
00035     int spawnTime;
00036     int actionsTaken;
00037     
00038     CCAnimation* idleAnim;
00039     CCAnimation* idleHelmetAnim;
00040     CCAnimation* walkingAnim;
00041     CCAnimation* walkingHelmetAnim;
00042     CCAnimation* openUmbrellaAnim;
00043     CCAnimation* floatUmbrellaAnim;
00044     CCAnimation* deathAnim;    
00045     
00046     // used in debugging
00047     int ID;                                 
00048     CCLabelBMFont* debugLabel;              
00049 }
00050 
00051 @property (readwrite) int health;
00052 @property (readwrite) CharacterStates state; 
00053 
00054 @property (readwrite) int helmetUses;
00055 @property (readwrite) int umbrellaUses;
00056 
00057 // idle and walking animations
00058 @property (nonatomic,retain) CCAnimation* idleAnim;
00059 @property (nonatomic,retain) CCAnimation* idleHelmetAnim;
00060 @property (nonatomic,retain) CCAnimation* walkingAnim;
00061 @property (nonatomic,retain) CCAnimation* walkingHelmetAnim;
00062 
00063 //misc animations
00064 @property (nonatomic,retain) CCAnimation* openUmbrellaAnim;
00065 @property (nonatomic,retain) CCAnimation* floatUmbrellaAnim;
00066 @property (nonatomic,retain) CCAnimation* deathAnim;
00067 
00068 // debugging
00069 @property (readwrite) int ID; 
00070 @property (nonatomic,retain) CCLabelBMFont* debugLabel;
00071 
00072 -(void)changeState:(CharacterStates)_newState;
00073 -(void)changeState:(CharacterStates)_newState afterDelay:(float)_delay;
00074 -(void)changeDirection;
00075 -(void)takePath:(Action)_decision;
00076 -(int)respawns;
00077 -(void)onObjectCollision:(GameObject*)_object;
00078 -(void)onEndConditionReached;
00079 -(void)updateDebugLabel;
00080 
00081 @end