Explorar el Código

Ajout position joueur

Arthur Brandao hace 6 años
padre
commit
2d30bde3aa
Se han modificado 2 ficheros con 4 adiciones y 0 borrados
  1. 2 0
      Serveur/player.c
  2. 2 0
      Serveur/player.h

+ 2 - 0
Serveur/player.c

@@ -13,6 +13,8 @@ void create_player(Player* p, Client* c){
     //Initialisation valeurs
     p->id = c->id;
     p->cli = c;
+    p->x = 0;
+    p->y = 0;
     p->life = 100;
     p->maxLife = 100;
     p->speed = 1;

+ 2 - 0
Serveur/player.h

@@ -17,6 +17,8 @@ typedef struct{
     /* Stats basique */
     int id; //Id du joueur <=> id du Client
     Client* cli; //Client pour communiquer avec le joueur
+    int x; //Position X (gauche droite)
+    int y; //Position Y (haut bas)
     int life; //Vie
     int maxLife; //Vie max
     int speed; //Vitesse de deplacement