From 3a2f69b3f1082b2fbdf39bd2a4f7ad0020971eac Mon Sep 17 00:00:00 2001 From: tom Date: Mon, 2 May 2016 15:39:22 -0500 Subject: spring cleaning, added framerate cap & started iterator replacement --- src/creature.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/creature.cpp') diff --git a/src/creature.cpp b/src/creature.cpp index d43bc2a..10274b6 100644 --- a/src/creature.cpp +++ b/src/creature.cpp @@ -1,6 +1,6 @@ #include "creature.hpp" -Creature::Creature(Window m, std::string s) //Constructor +Creature::Creature(Window m, std::string s) { texture = loadTexture(s, m); renderer = m.getRenderer(); @@ -8,7 +8,6 @@ Creature::Creature(Window m, std::string s) //Constructor maxHealth = 1000; hunger = 0; - //initializes random start coordinates for creature, target position is equivalent to it's position yPosition=yTarget=rand()%800; xPosition=xTarget=rand()%1200; hasTarget = false; @@ -19,7 +18,7 @@ Creature::Creature(Window m, std::string s) //Constructor int Creature::Behavior() { - health-=1; //Decrements health each time a behavior is executed + health-=1; this->Priority(); @@ -38,7 +37,7 @@ int Creature::Behavior() void Creature::Priority() { - double d; // lol + double d; // Gets location for closest resource for(int i = 0; i < nR.size(); i++) -- cgit v1.2.3