From 34e2794d647447f6ddb29419abbe2f44593ba1fa Mon Sep 17 00:00:00 2001 From: drumsetmonkey Date: Mon, 28 Sep 2015 10:51:18 -0400 Subject: Commented Entity Class, added more to debug screen, and changed colors of objects --- include/common.h | 6 +++--- include/entities.h | 22 ++++++++++++++-------- 2 files changed, 17 insertions(+), 11 deletions(-) (limited to 'include') diff --git a/include/common.h b/include/common.h index 922dd59..1210adb 100644 --- a/include/common.h +++ b/include/common.h @@ -11,7 +11,7 @@ #include typedef struct { float x; float y; } vec2; -enum _TYPE {STRUCTURET = -1, PLAYERT = 0, NPCT = 1}; +enum _TYPE {STRUCTURET = -1, PLAYERT = 0, NPCT = 1}; //these are the main types of entities #include @@ -19,12 +19,12 @@ enum _TYPE {STRUCTURET = -1, PLAYERT = 0, NPCT = 1}; #define SCREEN_HEIGHT 720 //#define FULLSCREEN -#define HLINE 3 +#define HLINE 3 //base unit of the world #define initRand(s) srand(s) #define getRand() rand() -template +template //this fuction returns the size of any array int eAmt(T (&)[N]){return N;} //SDL VARIABLES diff --git a/include/entities.h b/include/entities.h index df81ad2..53a8057 100644 --- a/include/entities.h +++ b/include/entities.h @@ -6,25 +6,31 @@ class Entity{ public: void *inWorld; - float width; + float width; //width and height of the player float height; - float speed; + float speed; //speed of the play + //type and subtype int subtype; _TYPE type; - vec2 loc; + //example: + //type 1(NPC) + // |(subtype) + // |-> 0 Base NPC + // |-> 1 Merchant + vec2 loc; //location and velocity of the entity vec2 vel; - bool right,left, canMove; - bool alive; - unsigned char ground; + bool right,left, canMove; //movement variables + bool alive; //the flag for whether or not the entity is alive + unsigned char ground; //variable for testing what ground the entity is on to apply certain traits - unsigned int texture[]; + unsigned int texture[]; //TODO: ADD TEXTURES void spawn(float, float); void draw(void); void wander(int, vec2*); virtual void interact(){} private: - int ticksToUse; + int ticksToUse; //The variable for deciding how long an entity should do a certain task }; class Player : public Entity{ -- cgit v1.2.3