summaryrefslogtreecommitdiff
path: root/inc
diff options
context:
space:
mode:
authorTom Barrett <tombarrett@siu.edu>2017-03-12 11:07:22 -0500
committerTom Barrett <tombarrett@siu.edu>2017-03-12 11:07:22 -0500
commit836f56a40fa4a2b8e68c23b2c299e50fefe0c15d (patch)
tree56ca750d4f2c93b5a72d52fd7c1d4b575b3c061a /inc
parent8f5a73f1daba39c8b0175036cf688f8ce1399a8f (diff)
-renamed constants to fit new datatypes
-reimplemented corpses -implemented hunger and starving (if creature is starving they will eat corpses and will take damage) -removed sides data from dna (think it is irrelavent) -removed data from dna that is not used for plants
Diffstat (limited to 'inc')
-rw-r--r--inc/constants.hpp39
-rw-r--r--inc/dna.hpp3
-rw-r--r--inc/organism.hpp2
3 files changed, 27 insertions, 17 deletions
diff --git a/inc/constants.hpp b/inc/constants.hpp
index 49b7678..76a40c1 100644
--- a/inc/constants.hpp
+++ b/inc/constants.hpp
@@ -4,36 +4,43 @@
// General
const int HERBAVORES = 100;
const int CARNIVORES = 50;;
-const int PLANTS = 5000;
const int MINIMUM_PLANTS = 4000;
+const int PLANTS = 5000;
const int WINDOW_X = 1000;
const int WINDOW_Y = 1000;
+const float BOUNDS = 30;
// Types
-const int PLANT_TYPE = 1;
-const int HERBAVORE_TYPE = 2;
-const int CARNIVORE_TYPE = 3;
-
-// Creatures
-const int CREATURE_MAX_HEALTH = 1000;
-const int CREATURE_BEST_SENSE = 1.5;
-const int CREATURE_BITE = 10;
-const int CREATURE_EXP_PREG_TIME = 100;
+const int HERBAVORE_TYPE = 1;
+const int CARNIVORE_TYPE = 2;
+const int PLANT_TYPE = 3;
+const int CORPSE_TYPE = 4;
+
+// Creature stats
+const int CREATURE_MAX_HEALTH = 100;
+const int CREATURE_BEST_SENSE = 2;
+const int CREATURE_BITE = 5;
+const int CREATURE_EXP_PREG_TIME = 1000;
const int CREATURE_EXP_AGE = 10000;
-const float CREATURE_SPEED = .1;
+const int CREATURE_HUNGRY_AMOUNT = 50;
+const int CREATURE_STARVE_AMOUNT = 90;
+const float CREATURE_SPEED = .05;
const float CREATURE_REACH = .1;
const float CREATURE_MUTATION_PERCENT = .25;
const float CREATURE_MUTATION_CHANCE = .05;
-// Resource
-const int RESOURCE_MAX_HEALTH = 200;
-const int RESOURCE_GROW_AMOUNT = 1;
+// Plant Stats
+const int PLANT_MAX_HEALTH = 200;
+const int PLANT_GROW_AMOUNT = 1;
+
+// Corpse Stats
+const int CORPSE_MAX_HEALTH = 400;
+const int CORPSE_DECAY_AMOUNT = -1;
// Opengl
const int NUM_SHADERS = 3;
const int NUM_UNIFORMS = 3;
-const float CREATURE_SIDES = 4;
-const float RESOURCE_SIDES = 10;
+const float SIDES = 5;
// Quadtree
const int MAX_OBJECTS = 5;
diff --git a/inc/dna.hpp b/inc/dna.hpp
index 01f373b..11886e9 100644
--- a/inc/dna.hpp
+++ b/inc/dna.hpp
@@ -22,6 +22,8 @@ class DNA
int expectedPregnancyTime;
int expectedAge;
int growAmount;
+ int hungryAmount;
+ int starveAmount;
float reach;
float speed;
@@ -29,7 +31,6 @@ class DNA
float mutationChance;
struct Visuals{
- float sides;
float red;
float green;
float blue;
diff --git a/inc/organism.hpp b/inc/organism.hpp
index 2a7a67c..954d25f 100644
--- a/inc/organism.hpp
+++ b/inc/organism.hpp
@@ -46,7 +46,9 @@ class Organism
int health;
int pregnancyTime;
int age;
+ int hunger;
+ bool starving;
bool gender;
bool pregnate;
bool hungry;