From 8c5121486a0e5d94ae5e5ee67370a31530cf8b6f Mon Sep 17 00:00:00 2001 From: tom Date: Fri, 8 May 2015 08:23:06 -0500 Subject: fixed some comments and cleaned around --- inc/creature.hpp | 2 +- inc/list.hpp | 1 + src/creature.cpp | 13 ++++--------- src/list.cpp | 3 +-- src/resource.cpp | 2 +- 5 files changed, 8 insertions(+), 13 deletions(-) diff --git a/inc/creature.hpp b/inc/creature.hpp index 9a26ee8..9bb73ee 100644 --- a/inc/creature.hpp +++ b/inc/creature.hpp @@ -19,7 +19,7 @@ class Creature: public Entity int yTarget; //y-coordinate of creature's target position int health; //health of a creature (0-100) int hunger; //value associated with a creatures want to find food (0-100) - std::vector location; //vector containing creatures location on window or target location? + std::vector location; //vector containing objects near the creature }; #endif diff --git a/inc/list.hpp b/inc/list.hpp index 074e045..dc5c412 100644 --- a/inc/list.hpp +++ b/inc/list.hpp @@ -16,6 +16,7 @@ class List private: //vectors containing objects of each type + Window * main;//will be needed for adding R's and C's after constructor. std::vector R; std::vector C; std::vector L; diff --git a/src/creature.cpp b/src/creature.cpp index ef3d6c1..5c3bb8e 100644 --- a/src/creature.cpp +++ b/src/creature.cpp @@ -8,16 +8,13 @@ Creature::Creature(Window m, std::string s) //Constructor hunger = 0; //initializes random start coordinates for creature, target position is equivalent to it's position - int yStart = rand()%800; - int xStart = rand()%1200; - yPosition=yTarget=yStart; - xPosition=xTarget=xStart; + yPosition=yTarget=rand()%800; + xPosition=xTarget=rand()%1200; } void Creature::Behavior() { health--; //Decrements health each time a behavior is executed - //Detection this->Priority(); //Checks which action has priority (doesn't really do this right now) this->Action(); //Does action } @@ -28,19 +25,17 @@ void Creature::Priority() int i; for(i=0;i