summaryrefslogtreecommitdiff
path: root/src/creature.cpp
diff options
context:
space:
mode:
authortom <tom@ground-control>2016-05-02 15:39:22 -0500
committertom <tom@ground-control>2016-05-02 15:39:22 -0500
commit3a2f69b3f1082b2fbdf39bd2a4f7ad0020971eac (patch)
treec5961dcb6e1ccbdf5a478d97f7383028492140d4 /src/creature.cpp
parent1ddb996ac4a4fc78e5484acdadac2df95006b632 (diff)
spring cleaning, added framerate cap & started iterator replacement
Diffstat (limited to 'src/creature.cpp')
-rw-r--r--src/creature.cpp7
1 files changed, 3 insertions, 4 deletions
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++)