diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/common.h | 6 | ||||
-rw-r--r-- | include/entities.h | 12 |
2 files changed, 14 insertions, 4 deletions
diff --git a/include/common.h b/include/common.h index e1b536f..f32aad0 100644 --- a/include/common.h +++ b/include/common.h @@ -15,7 +15,8 @@ typedef struct{float x; float y;}vec2; #include <World.h> #define SCREEN_WIDTH 1280 -#define SCREEN_HEIGHT 800 +#define SCREEN_HEIGHT 720 +#define SCREEN_RATIO (float)SCREEN_WIDTH/(float)SCREEN_HEIGHT //#define FULLSCREEN #define HLINE (2.0f / (SCREEN_WIDTH / 4)) @@ -23,6 +24,9 @@ typedef struct{float x; float y;}vec2; #define irand srand #define grand rand +template<typename T, size_t N> +int eAmt(T (&)[N]){return N;} + //SDL VARIABLES extern SDL_Window *window; extern SDL_Surface *renderSurface; diff --git a/include/entities.h b/include/entities.h index 752908b..2ed97ee 100644 --- a/include/entities.h +++ b/include/entities.h @@ -3,6 +3,8 @@ #include <common.h> +extern int npcAmt; + class Entity{ public: float width; @@ -11,10 +13,14 @@ public: int type, subtype; vec2 loc; vec2 vel; - bool right,left; + bool right,left, canMove; + bool alive; void spawn(float, float); void draw(void); + void wander(int, vec2*); +private: + int ticksToUse; }; class Player : public Entity{ @@ -27,8 +33,8 @@ public: NPC(); }; -extern Entity *entnpc[10]; //The NPC base -extern NPC npc[10]; +extern Entity *entnpc[32]; //The NPC base +extern NPC npc[32]; class Structures : public Entity{ public: |