From b97a54b8acd113e99871fdb0f683e27e0912bf42 Mon Sep 17 00:00:00 2001 From: tom Date: Wed, 11 Jan 2017 02:19:07 -0600 Subject: -removed all magic numbers and placed them in a constants header -removed unused libraries and redid all header files --- src/creature.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/creature.cpp') diff --git a/src/creature.cpp b/src/creature.cpp index 7e9011a..b81153e 100644 --- a/src/creature.cpp +++ b/src/creature.cpp @@ -10,8 +10,8 @@ Creature::Creature(Window m, int size) L.x = rect.x; L.y = rect.y; - health = 500; - maxHealth = 1000; + health = CREATURE_START_HEALTH; + maxHealth = CREATURE_MAX_HEALTH; hungry = false; hasTarget = false; @@ -61,7 +61,7 @@ void Creature::setTarget() if(!hasTarget&&!wander){ wander = true; - wTarget = Location(rand()%1200,rand()%800); + wTarget = Location(rand()%WINDOW_X,rand()%WINDOW_Y); } } @@ -69,7 +69,7 @@ void Creature::setTarget() void Creature::Action() { if(hasTarget){ - if(Distance(L,target->getLocation())<5){ + if(Distance(L,target->getLocation())eat(); health+=10; } -- cgit v1.2.3