summaryrefslogtreecommitdiff
path: root/src/creature.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/creature.cpp')
-rw-r--r--src/creature.cpp40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/creature.cpp b/src/creature.cpp
index c96785e..437837d 100644
--- a/src/creature.cpp
+++ b/src/creature.cpp
@@ -5,4 +5,44 @@ Creature::Creature(Window m, std::string s)
texture = loadTexture(s, m);
renderer = m.getRenderer();
x=y=500;
+
+ //For the test resource
+ xT=yT=300;
+}
+
+void Creature::Behavior()
+{
+ //Detection
+
+ //Priorities
+
+ //Action
+ this->Action();
+}
+
+void Creature::Action()
+{
+ //if(isclose)
+ // eat//reproduce//etc;
+
+ if(x==xT)
+ {
+ if(y<yT)
+ y++;
+ else
+ y--;
+ }
+ else if(y==yT)
+ {
+ if(x<xT)
+ x++;
+ else
+ x--;
+ }
+ else
+ {
+ srand(time(NULL));
+ z = rand%1;
+ if(
+ }
}