From 5d97a0154ed1c5584c50884e086dcaa3536e5672 Mon Sep 17 00:00:00 2001 From: tom Date: Sat, 2 May 2015 17:31:50 -0500 Subject: added basic movement --- inc/window.h | 1 + src/creature.cpp | 26 ++++++++++++++++++-------- src/main.cpp | 1 + 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/inc/window.h b/inc/window.h index 17ba597..d2dd801 100644 --- a/inc/window.h +++ b/inc/window.h @@ -7,6 +7,7 @@ #include #include #include +#include class Window { diff --git a/src/creature.cpp b/src/creature.cpp index 207d3bd..d958d09 100644 --- a/src/creature.cpp +++ b/src/creature.cpp @@ -22,26 +22,36 @@ void Creature::Behavior() void Creature::Action() { - //if(isclose) - // eat//reproduce//etc; + //std::cout << (sqrt(((x-xT)^2)+((y-yT)^2)); + if((sqrt(((x-xT)^2)+((y-yT)^2)))<2) + return; //eat//reproduce//etc; if(x==xT) - { if(y