From d10f3df359cbccd1d7ee13b7981fee575a90637f Mon Sep 17 00:00:00 2001 From: majortom6 Date: Sat, 25 Feb 2017 12:42:41 -0600 Subject: -began refractoring src -reduced area creatures and resources spawn -everything should be on 8 spaces now -reorganized creatures action function to make more logical sense -stripped out unused parts of geoshader and spritebatch --- inc/constants.hpp | 54 ++++++++++++++++++++++++---------------------- inc/creature.hpp | 6 +++--- inc/opengl/spritebatch.hpp | 5 ++--- inc/resource.hpp | 2 +- 4 files changed, 34 insertions(+), 33 deletions(-) (limited to 'inc') diff --git a/inc/constants.hpp b/inc/constants.hpp index fbcb454..518f2ac 100644 --- a/inc/constants.hpp +++ b/inc/constants.hpp @@ -2,43 +2,45 @@ #define constants_h // General -const int CREATURES = 100; -const int RESOURCES = 1000; -const int MINIMUM_RESOURCES = 800; -const int WINDOW_X = 1000; -const int WINDOW_Y = 1000; +const int CREATURES = 100; +const int RESOURCES = 1000; +const int MINIMUM_RESOURCES = 800; +const int WINDOW_X = 1000; +const int WINDOW_Y = 1000; // Types -const int CREATURE_TYPE = 1; -const int RESOURCE_TYPE = 2; +const int CREATURE_TYPE = 1; +const int RESOURCE_TYPE = 2; // Creatures -const int CREATURE_MAX_HEALTH = 1000; -const int CREATURE_REACH = 1; -const int CREATURE_BEST_SENSE = 10; -const int CREATURE_BITE = 10; -const int CREATURE_AMOUNT_TO_GROW = 50; -const int CREATURE_EXP_PREG_TIME = 100; -const int CREATURE_EXP_AGE = 1000000; -const int CREATURE_SIZE_MAX = 10; -const float CREATURE_SPEED = .1; +const int CREATURE_MAX_HEALTH = 1000; +const int CREATURE_REACH = 1; +const int CREATURE_BEST_SENSE = 1; +const int CREATURE_BITE = 10; +const int CREATURE_AMOUNT_TO_GROW = 50; +const int CREATURE_EXP_PREG_TIME = 100; +const int CREATURE_EXP_AGE = 1000000; +const int CREATURE_SIZE_MAX = 10; +const float CREATURE_SPEED = .1; // Resource -const int RESOURCE_SIZE_STAR = 1; -const int RESOURCE_SIZE_MAX = 4; -const int RESOURCE_AMOUNT_START = 100; -const int RESOURCE_AMOUNT_MAX = 200; -const int RESOURCE_GROW = 1; +const int RESOURCE_SIZE_START = 1; +const int RESOURCE_SIZE_MAX = 4; +const int RESOURCE_AMOUNT_START = 100; +const int RESOURCE_AMOUNT_MAX = 200; +const int RESOURCE_GROW = 1; // Opengl -const int NUM_SHADERS = 3; -const int NUM_UNIFORMS = 3; +const int NUM_SHADERS = 3; +const int NUM_UNIFORMS = 3; +const float CREATURE_SIDES = 4.0; +const float RESOURCE_SIDES = 10; // Quadtree -const int MAX_OBJECTS = 5; -const int MAX_LEVELS = 6; +const int MAX_OBJECTS = 5; +const int MAX_LEVELS = 6; // Camera -const float MOVE_AMOUNT = .2; +const float MOVE_AMOUNT = .2; #endif diff --git a/inc/creature.hpp b/inc/creature.hpp index 01f6557..f9cb979 100644 --- a/inc/creature.hpp +++ b/inc/creature.hpp @@ -12,15 +12,15 @@ class Creature: public Entity { public: - Creature(Rectangle t, DNA D); + Creature(Rectangle r, DNA d); void Behavior(); void Action(); void Priority(); void setTarget(); void checkTarget(); - void moveTowards(Rectangle t); - void impregnate(DNA D); + void moveTowards(Rectangle r); + void impregnate(DNA d); void giveNearMe(std::list n){nearMe = {std::begin(n),std::end(n)};}; DNA getDNA(){return myDNA;}; diff --git a/inc/opengl/spritebatch.hpp b/inc/opengl/spritebatch.hpp index 94ca97c..2618054 100644 --- a/inc/opengl/spritebatch.hpp +++ b/inc/opengl/spritebatch.hpp @@ -20,7 +20,6 @@ class SpriteBatch { public: SpriteBatch(GeoShader theshader); - ~SpriteBatch(); void init(); void begin(); @@ -35,8 +34,8 @@ class SpriteBatch GLuint _vbo; GLuint _vao; - std::vector _gfxPtr; ///< This is for sorting - std::vector _gfx; ///< These are the actual glyphs + std::vector _gfxPtr; + std::vector _gfx; std::vector _renderBatches; GeoShader shader; diff --git a/inc/resource.hpp b/inc/resource.hpp index 07d42d4..e559463 100644 --- a/inc/resource.hpp +++ b/inc/resource.hpp @@ -9,7 +9,7 @@ class Resource: public Entity { public: - Resource(Rectangle t); + Resource(Rectangle r); void grow(); void eat(int bite); -- cgit v1.2.3