Index: common/Common.h
===================================================================
--- common/Common.h	(revision 62ee2ceb8ecee33c00a41267ea1c22a94758a04d)
+++ common/Common.h	(revision 60017fc77171d89da05e3eaab5eb4a9c3d0a0f6e)
@@ -20,3 +20,9 @@
 } POSITION;
 
+typedef struct
+{
+   float x;
+   float y;
+} FLOAT_POSITION;
+
 #endif
Index: common/Player.cpp
===================================================================
--- common/Player.cpp	(revision 62ee2ceb8ecee33c00a41267ea1c22a94758a04d)
+++ common/Player.cpp	(revision 60017fc77171d89da05e3eaab5eb4a9c3d0a0f6e)
@@ -4,4 +4,5 @@
 #include <sstream>
 #include <cstring>
+#include <cmath>
 
 using namespace std;
@@ -12,6 +13,6 @@
    this->name = "";
    this->password = "";
-   this->pos.x = 0;
-   this->pos.y = 0;
+   this->pos.x = this->target.x = 0;
+   this->pos.y = this->target.y = 0;
 }
 
@@ -23,4 +24,6 @@
    this->pos.x = p.pos.x;
    this->pos.y = p.pos.y;
+   this->target.x = p.target.x;
+   this->target.y = p.target.y;
    this->addr = p.addr;
 }
@@ -31,6 +34,6 @@
    this->name = name;
    this->password = password;
-   this->pos.x = 200;
-   this->pos.y = 200;
+   this->pos.x = this->target.x = 200;
+   this->pos.y = this->target.y = 200;
 }
 
@@ -40,6 +43,6 @@
    this->name = name;
    this->password = "";
-   this->pos.x = 200;
-   this->pos.y = 200;
+   this->pos.x = this->target.x = 200;
+   this->pos.y = this->target.y = 200;
    this->addr = addr;
 }
@@ -79,2 +82,36 @@
    this->addr = addr;
 }
+
+void Player::move(void) {
+   // timeLastMoved
+   // pos
+   // target
+   int speed = 100; // pixels per second
+
+   timespec curTS, diffTS;
+   clock_gettime(CLOCK_REALTIME, &curTS);
+
+   // get time elapsed
+   diffTS.tv_sec = curTS.tv_sec - timeLastUpdated.tv_sec;
+   diffTS.tv_nsec = curTS.tv_nsec - timeLastUpdated.tv_nsec;
+   if (diffTS.tv_nsec < 0) {
+      diffTS.tv_sec -= 1;
+      diffTS.tv_nsec += 1000000000;
+   }
+
+   cout << "elapsed secs: " << diffTS.tv_sec << endl;
+   cout << "elapsed nsecs: " << diffTS.tv_nsec << endl;
+
+   // here we move 100 pixels per second
+   float pixels = 100 * (diffTS.tv_sec+diffTS.tv_nsec/1000000000.0);
+   cout << "We need to move " << pixels << "pixels" << endl;
+
+   double angle = atan2(target.y-pos.y, target.x-pos.x);
+
+   // we just need to check that we don't overjump the target
+   pos.x += cos(angle)*pixels;
+   pos.y += sin(angle)*pixels;
+
+   timeLastUpdated.tv_sec = curTS.tv_sec;
+   timeLastUpdated.tv_nsec = curTS.tv_nsec;
+}
Index: common/Player.h
===================================================================
--- common/Player.h	(revision 62ee2ceb8ecee33c00a41267ea1c22a94758a04d)
+++ common/Player.h	(revision 60017fc77171d89da05e3eaab5eb4a9c3d0a0f6e)
@@ -12,4 +12,5 @@
 
 #include <string>
+#include <sys/time.h>
 
 #include "Common.h"
@@ -32,9 +33,13 @@
    void setAddr(sockaddr_in addr);
 
+   void move();
+
    int id;
    string name;
    string password;
    sockaddr_in addr;
-   POSITION pos;
+   FLOAT_POSITION pos;
+   POSITION target;
+   timespec timeLastUpdated;
 };
 
