From 42d7b3bb511333e242a74f360873deb64cd89522 Mon Sep 17 00:00:00 2001 From: tom Date: Mon, 2 May 2016 16:08:20 -0500 Subject: spring cleaning --- inc/creature.hpp | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'inc/creature.hpp') diff --git a/inc/creature.hpp b/inc/creature.hpp index 64efd26..875b498 100644 --- a/inc/creature.hpp +++ b/inc/creature.hpp @@ -15,28 +15,29 @@ class Creature: public Entity Location getLocation(); void giveR(vector n){nR=n;}; void giveC(vector n){nC=n;}; + + double Distance(Location A, Location B){return sqrt(pow(A.x-B.x,2)+pow(A.y-B.y,2));}; int getHealth(){return health;}; - double Distance(Location A, Location B); - bool doesItHaveTarget(); + bool doesItHaveTarget(){return hasTarget;}; int getBestSense(){return bestSense;}; private: - int xTarget; //x-coordinate of creature's target position - int yTarget; //y-coordinate of creature's target position + int xTarget; + int yTarget; bool hasTarget; bool wandering; - int health; //health of a creature (0-100) + int health; int maxHealth; - int hunger; //value associated with a creatures want to find food (0-100) - int speed = 1; - bool able; // ability to reproduce - int bestSense = 100; // Distance it can see/smell/hear + int hunger; + int speed = 2; + bool able; + int bestSense = 100; vector nR; //vector containing resources near the creature vector nC; //vector containing creatures near the creature - int n; // counter for which place in resource array is targeted + int n; }; #endif -- cgit v1.2.3