diff --git a/build/CMakeFiles/MCC.dir/apps/main.cpp.o b/build/CMakeFiles/MCC.dir/apps/main.cpp.o
index 8876ec85f3088937c53e53af47004c04d511dbdb..1aaf693660c1d7c0990e98655953b6d18020fa6d 100644
Binary files a/build/CMakeFiles/MCC.dir/apps/main.cpp.o and b/build/CMakeFiles/MCC.dir/apps/main.cpp.o differ
diff --git a/build/CMakeFiles/MCC.dir/apps/main.cpp.o.d b/build/CMakeFiles/MCC.dir/apps/main.cpp.o.d
index 0a794953a201212946670b1af5c925621818703b..8c8007e9f1f834282d9cbefefdb9672896a92830 100644
--- a/build/CMakeFiles/MCC.dir/apps/main.cpp.o.d
+++ b/build/CMakeFiles/MCC.dir/apps/main.cpp.o.d
@@ -401,6 +401,7 @@ CMakeFiles/MCC.dir/apps/main.cpp.o: \
  /usr/include/c++/14.1.1/bits/unique_ptr.h \
  /usr/include/c++/14.1.1/bits/fs_dir.h \
  /usr/include/c++/14.1.1/bits/fs_ops.h \
+ /home/alexis/Documents/Mythical_Conquests_Chronicles/apps/../include/game/../manager/../utils/include/utils.hpp \
  /home/alexis/Documents/Mythical_Conquests_Chronicles/apps/../include/game/../manager/WorldManager.hpp \
  /home/alexis/Documents/Mythical_Conquests_Chronicles/apps/../include/game/../manager/../utils/include/enum.hpp \
  /home/alexis/Documents/Mythical_Conquests_Chronicles/apps/../include/game/../manager/BodyFactory.hpp \
diff --git a/build/CMakeFiles/MCC.dir/compiler_depend.internal b/build/CMakeFiles/MCC.dir/compiler_depend.internal
index d89494e17a6f864ba9a959bec7eb8f8e7277122b..e91fea5388f3916c92f873003837cbd142426187 100644
--- a/build/CMakeFiles/MCC.dir/compiler_depend.internal
+++ b/build/CMakeFiles/MCC.dir/compiler_depend.internal
@@ -78,6 +78,7 @@ CMakeFiles/MCC.dir/apps/main.cpp.o
  /home/alexis/Documents/Mythical_Conquests_Chronicles/include/game/Tile.hpp
  /home/alexis/Documents/Mythical_Conquests_Chronicles/include/utils/include/constante.h
  /home/alexis/Documents/Mythical_Conquests_Chronicles/include/utils/include/enum.hpp
+ /home/alexis/Documents/Mythical_Conquests_Chronicles/include/utils/include/utils.hpp
  /home/alexis/Documents/Mythical_Conquests_Chronicles/libs/qrcodegen/include/qrcodegen.hpp
  /home/alexis/Documents/Mythical_Conquests_Chronicles/include/manager/NetworkManager.hpp
  /home/alexis/Documents/Mythical_Conquests_Chronicles/include/manager/BodyFactory.hpp
@@ -655,6 +656,7 @@ CMakeFiles/MCC.dir/src/game/Game.cpp.o
  /home/alexis/Documents/Mythical_Conquests_Chronicles/include/game/Tile.hpp
  /home/alexis/Documents/Mythical_Conquests_Chronicles/include/utils/include/constante.h
  /home/alexis/Documents/Mythical_Conquests_Chronicles/include/utils/include/enum.hpp
+ /home/alexis/Documents/Mythical_Conquests_Chronicles/include/utils/include/utils.hpp
  /home/alexis/Documents/Mythical_Conquests_Chronicles/libs/qrcodegen/include/qrcodegen.hpp
  /home/alexis/Documents/Mythical_Conquests_Chronicles/include/manager/NetworkManager.hpp
  /home/alexis/Documents/Mythical_Conquests_Chronicles/include/manager/BodyFactory.hpp
@@ -1225,6 +1227,7 @@ CMakeFiles/MCC.dir/src/game/GameEntities.cpp.o
  /home/alexis/Documents/Mythical_Conquests_Chronicles/libs/RapidJson/include/rapidjson/stream.h
  /home/alexis/Documents/Mythical_Conquests_Chronicles/libs/RapidJson/include/rapidjson/stringbuffer.h
  /home/alexis/Documents/Mythical_Conquests_Chronicles/libs/RapidJson/include/rapidjson/writer.h
+ /home/alexis/Documents/Mythical_Conquests_Chronicles/include/utils/include/utils.hpp
  /home/alexis/Documents/Mythical_Conquests_Chronicles/include/manager/NetworkManager.hpp
  /home/alexis/Documents/Mythical_Conquests_Chronicles/include/manager/MenuManager.hpp
  /home/alexis/Documents/Mythical_Conquests_Chronicles/include/utils/include/Timer.hpp
@@ -1809,6 +1812,7 @@ CMakeFiles/MCC.dir/src/game/Map.cpp.o
  /home/alexis/Documents/Mythical_Conquests_Chronicles/include/game/Tile.hpp
  /home/alexis/Documents/Mythical_Conquests_Chronicles/include/utils/include/constante.h
  /home/alexis/Documents/Mythical_Conquests_Chronicles/include/utils/include/enum.hpp
+ /home/alexis/Documents/Mythical_Conquests_Chronicles/include/utils/include/utils.hpp
  /home/alexis/Documents/Mythical_Conquests_Chronicles/libs/qrcodegen/include/qrcodegen.hpp
  /home/alexis/Documents/Mythical_Conquests_Chronicles/include/manager/NetworkManager.hpp
  /home/alexis/Documents/Mythical_Conquests_Chronicles/include/manager/BodyFactory.hpp
@@ -3797,6 +3801,7 @@ CMakeFiles/MCC.dir/src/manager/MenuManager.cpp.o
  /home/alexis/Documents/Mythical_Conquests_Chronicles/include/manager/WorldManager.hpp
  /home/alexis/Documents/Mythical_Conquests_Chronicles/include/game/Game.hpp
  /home/alexis/Documents/Mythical_Conquests_Chronicles/include/utils/include/constante.h
+ /home/alexis/Documents/Mythical_Conquests_Chronicles/include/utils/include/utils.hpp
  /home/alexis/Documents/Mythical_Conquests_Chronicles/include/manager/NetworkManager.hpp
  /home/alexis/Documents/Mythical_Conquests_Chronicles/include/manager/IActor.hpp
  /home/alexis/Documents/Mythical_Conquests_Chronicles/include/manager/MenuManager.hpp
@@ -5293,6 +5298,7 @@ CMakeFiles/MCC.dir/src/manager/WorldManager.cpp.o
  /home/alexis/Documents/Mythical_Conquests_Chronicles/libs/RapidJson/include/rapidjson/stream.h
  /home/alexis/Documents/Mythical_Conquests_Chronicles/libs/RapidJson/include/rapidjson/stringbuffer.h
  /home/alexis/Documents/Mythical_Conquests_Chronicles/libs/RapidJson/include/rapidjson/writer.h
+ /home/alexis/Documents/Mythical_Conquests_Chronicles/include/utils/include/utils.hpp
  /home/alexis/Documents/Mythical_Conquests_Chronicles/include/manager/NetworkManager.hpp
  /home/alexis/Documents/Mythical_Conquests_Chronicles/include/manager/MenuManager.hpp
  /home/alexis/Documents/Mythical_Conquests_Chronicles/include/utils/include/Timer.hpp
diff --git a/build/CMakeFiles/MCC.dir/compiler_depend.make b/build/CMakeFiles/MCC.dir/compiler_depend.make
index a990c6a5e4278b2e042a524231e65507349ce859..32196be033491be90a04669ebb2ef5de61a7a895 100644
--- a/build/CMakeFiles/MCC.dir/compiler_depend.make
+++ b/build/CMakeFiles/MCC.dir/compiler_depend.make
@@ -77,6 +77,7 @@ CMakeFiles/MCC.dir/apps/main.cpp.o: /home/alexis/Documents/Mythical_Conquests_Ch
   /home/alexis/Documents/Mythical_Conquests_Chronicles/include/game/Tile.hpp \
   /home/alexis/Documents/Mythical_Conquests_Chronicles/include/utils/include/constante.h \
   /home/alexis/Documents/Mythical_Conquests_Chronicles/include/utils/include/enum.hpp \
+  /home/alexis/Documents/Mythical_Conquests_Chronicles/include/utils/include/utils.hpp \
   /home/alexis/Documents/Mythical_Conquests_Chronicles/libs/qrcodegen/include/qrcodegen.hpp \
   /home/alexis/Documents/Mythical_Conquests_Chronicles/include/manager/NetworkManager.hpp \
   /home/alexis/Documents/Mythical_Conquests_Chronicles/include/manager/BodyFactory.hpp \
@@ -653,6 +654,7 @@ CMakeFiles/MCC.dir/src/game/Game.cpp.o: /home/alexis/Documents/Mythical_Conquest
   /home/alexis/Documents/Mythical_Conquests_Chronicles/include/game/Tile.hpp \
   /home/alexis/Documents/Mythical_Conquests_Chronicles/include/utils/include/constante.h \
   /home/alexis/Documents/Mythical_Conquests_Chronicles/include/utils/include/enum.hpp \
+  /home/alexis/Documents/Mythical_Conquests_Chronicles/include/utils/include/utils.hpp \
   /home/alexis/Documents/Mythical_Conquests_Chronicles/libs/qrcodegen/include/qrcodegen.hpp \
   /home/alexis/Documents/Mythical_Conquests_Chronicles/include/manager/NetworkManager.hpp \
   /home/alexis/Documents/Mythical_Conquests_Chronicles/include/manager/BodyFactory.hpp \
@@ -1222,6 +1224,7 @@ CMakeFiles/MCC.dir/src/game/GameEntities.cpp.o: /home/alexis/Documents/Mythical_
   /home/alexis/Documents/Mythical_Conquests_Chronicles/libs/RapidJson/include/rapidjson/stream.h \
   /home/alexis/Documents/Mythical_Conquests_Chronicles/libs/RapidJson/include/rapidjson/stringbuffer.h \
   /home/alexis/Documents/Mythical_Conquests_Chronicles/libs/RapidJson/include/rapidjson/writer.h \
+  /home/alexis/Documents/Mythical_Conquests_Chronicles/include/utils/include/utils.hpp \
   /home/alexis/Documents/Mythical_Conquests_Chronicles/include/manager/NetworkManager.hpp \
   /home/alexis/Documents/Mythical_Conquests_Chronicles/include/manager/MenuManager.hpp \
   /home/alexis/Documents/Mythical_Conquests_Chronicles/include/utils/include/Timer.hpp \
@@ -1805,6 +1808,7 @@ CMakeFiles/MCC.dir/src/game/Map.cpp.o: /home/alexis/Documents/Mythical_Conquests
   /home/alexis/Documents/Mythical_Conquests_Chronicles/include/game/Tile.hpp \
   /home/alexis/Documents/Mythical_Conquests_Chronicles/include/utils/include/constante.h \
   /home/alexis/Documents/Mythical_Conquests_Chronicles/include/utils/include/enum.hpp \
+  /home/alexis/Documents/Mythical_Conquests_Chronicles/include/utils/include/utils.hpp \
   /home/alexis/Documents/Mythical_Conquests_Chronicles/libs/qrcodegen/include/qrcodegen.hpp \
   /home/alexis/Documents/Mythical_Conquests_Chronicles/include/manager/NetworkManager.hpp \
   /home/alexis/Documents/Mythical_Conquests_Chronicles/include/manager/BodyFactory.hpp \
@@ -3788,6 +3792,7 @@ CMakeFiles/MCC.dir/src/manager/MenuManager.cpp.o: /home/alexis/Documents/Mythica
   /home/alexis/Documents/Mythical_Conquests_Chronicles/include/manager/WorldManager.hpp \
   /home/alexis/Documents/Mythical_Conquests_Chronicles/include/game/Game.hpp \
   /home/alexis/Documents/Mythical_Conquests_Chronicles/include/utils/include/constante.h \
+  /home/alexis/Documents/Mythical_Conquests_Chronicles/include/utils/include/utils.hpp \
   /home/alexis/Documents/Mythical_Conquests_Chronicles/include/manager/NetworkManager.hpp \
   /home/alexis/Documents/Mythical_Conquests_Chronicles/include/manager/IActor.hpp \
   /home/alexis/Documents/Mythical_Conquests_Chronicles/include/manager/MenuManager.hpp \
@@ -5281,6 +5286,7 @@ CMakeFiles/MCC.dir/src/manager/WorldManager.cpp.o: /home/alexis/Documents/Mythic
   /home/alexis/Documents/Mythical_Conquests_Chronicles/libs/RapidJson/include/rapidjson/stream.h \
   /home/alexis/Documents/Mythical_Conquests_Chronicles/libs/RapidJson/include/rapidjson/stringbuffer.h \
   /home/alexis/Documents/Mythical_Conquests_Chronicles/libs/RapidJson/include/rapidjson/writer.h \
+  /home/alexis/Documents/Mythical_Conquests_Chronicles/include/utils/include/utils.hpp \
   /home/alexis/Documents/Mythical_Conquests_Chronicles/include/manager/NetworkManager.hpp \
   /home/alexis/Documents/Mythical_Conquests_Chronicles/include/manager/MenuManager.hpp \
   /home/alexis/Documents/Mythical_Conquests_Chronicles/include/utils/include/Timer.hpp \
@@ -5831,6 +5837,8 @@ CMakeFiles/MCC.dir/src/manager/WorldManager.cpp.o: /home/alexis/Documents/Mythic
 
 /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/include/rtmintrin.h:
 
+/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/include/rdseedintrin.h:
+
 /usr/include/c++/14.1.1/limits:
 
 /usr/include/linux/posix_types.h:
@@ -6013,8 +6021,6 @@ CMakeFiles/MCC.dir/src/manager/WorldManager.cpp.o: /home/alexis/Documents/Mythic
 
 /usr/include/bits/confname.h:
 
-/usr/include/c++/14.1.1/bits/cpp_type_traits.h:
-
 /usr/include/bits/byteswap.h:
 
 /usr/include/SDL2/SDL_video.h:
@@ -6049,6 +6055,8 @@ CMakeFiles/MCC.dir/src/manager/WorldManager.cpp.o: /home/alexis/Documents/Mythic
 
 /usr/include/c++/14.1.1/bits/erase_if.h:
 
+/usr/include/SDL2/SDL_thread.h:
+
 /home/alexis/Documents/Mythical_Conquests_Chronicles/libs/Box2d/include/box2d/b2_world_callbacks.h:
 
 /home/alexis/Documents/Mythical_Conquests_Chronicles/libs/Box2d/include/box2d/b2_chain_shape.h:
@@ -6207,10 +6215,6 @@ CMakeFiles/MCC.dir/src/manager/WorldManager.cpp.o: /home/alexis/Documents/Mythic
 
 /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/include/avx512bitalgintrin.h:
 
-/usr/include/asm-generic/errno-base.h:
-
-/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/include/avxvnniint16intrin.h:
-
 /home/alexis/Documents/Mythical_Conquests_Chronicles/libs/Box2d/include/box2d/b2_body.h:
 
 /usr/include/c++/14.1.1/bits/locale_facets_nonio.h:
@@ -6247,6 +6251,12 @@ CMakeFiles/MCC.dir/src/manager/WorldManager.cpp.o: /home/alexis/Documents/Mythic
 
 /usr/include/c++/14.1.1/bits/stl_iterator.h:
 
+/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/include/avxvnniint16intrin.h:
+
+/usr/include/asm-generic/errno-base.h:
+
+/home/alexis/Documents/Mythical_Conquests_Chronicles/include/utils/include/utils.hpp:
+
 /home/alexis/Documents/Mythical_Conquests_Chronicles/include/game/Map.hpp:
 
 /usr/include/c++/14.1.1/memory:
@@ -6487,7 +6497,7 @@ CMakeFiles/MCC.dir/src/manager/WorldManager.cpp.o: /home/alexis/Documents/Mythic
 
 /usr/include/string.h:
 
-/usr/include/SDL2/SDL_thread.h:
+/usr/include/c++/14.1.1/bits/cpp_type_traits.h:
 
 /usr/include/c++/14.1.1/bits/cxxabi_init_exception.h:
 
@@ -6779,8 +6789,6 @@ CMakeFiles/MCC.dir/src/manager/WorldManager.cpp.o: /home/alexis/Documents/Mythic
 
 /usr/include/c++/14.1.1/x86_64-pc-linux-gnu/bits/error_constants.h:
 
-/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/include/rdseedintrin.h:
-
 /usr/include/asm/posix_types.h:
 
 /usr/include/c++/14.1.1/x86_64-pc-linux-gnu/bits/basic_file.h:
diff --git a/build/CMakeFiles/MCC.dir/src/game/Game.cpp.o b/build/CMakeFiles/MCC.dir/src/game/Game.cpp.o
index 47439db743b12bcf30860b6036179fe4f4d39495..0aebbe9d38d1020dd3b516f1b776d90aab795eea 100644
Binary files a/build/CMakeFiles/MCC.dir/src/game/Game.cpp.o and b/build/CMakeFiles/MCC.dir/src/game/Game.cpp.o differ
diff --git a/build/CMakeFiles/MCC.dir/src/game/Game.cpp.o.d b/build/CMakeFiles/MCC.dir/src/game/Game.cpp.o.d
index 83641ccbe172ef9964d5691dcd5e3bd4e8f3448b..f4764e7c6f213ae8559809246c0c706ccbc1903d 100644
--- a/build/CMakeFiles/MCC.dir/src/game/Game.cpp.o.d
+++ b/build/CMakeFiles/MCC.dir/src/game/Game.cpp.o.d
@@ -401,6 +401,7 @@ CMakeFiles/MCC.dir/src/game/Game.cpp.o: \
  /usr/include/c++/14.1.1/bits/unique_ptr.h \
  /usr/include/c++/14.1.1/bits/fs_dir.h \
  /usr/include/c++/14.1.1/bits/fs_ops.h \
+ /home/alexis/Documents/Mythical_Conquests_Chronicles/src/game/../../include/game/../manager/../utils/include/utils.hpp \
  /home/alexis/Documents/Mythical_Conquests_Chronicles/src/game/../../include/game/../manager/WorldManager.hpp \
  /home/alexis/Documents/Mythical_Conquests_Chronicles/src/game/../../include/game/../manager/../utils/include/enum.hpp \
  /home/alexis/Documents/Mythical_Conquests_Chronicles/src/game/../../include/game/../manager/BodyFactory.hpp \
diff --git a/build/CMakeFiles/MCC.dir/src/game/GameEntities.cpp.o b/build/CMakeFiles/MCC.dir/src/game/GameEntities.cpp.o
index 5759374b45c1f4825a8bb6a62160db4c1064d710..0c3206a457e391a60cb6b9c51356604c9c95a640 100644
Binary files a/build/CMakeFiles/MCC.dir/src/game/GameEntities.cpp.o and b/build/CMakeFiles/MCC.dir/src/game/GameEntities.cpp.o differ
diff --git a/build/CMakeFiles/MCC.dir/src/game/GameEntities.cpp.o.d b/build/CMakeFiles/MCC.dir/src/game/GameEntities.cpp.o.d
index 601e24c4b2e51a0325ecd59ecbda4fa5d7cc06c4..03bed4b5ee88d0917394f65ab95b7e6bb27ba0ce 100644
--- a/build/CMakeFiles/MCC.dir/src/game/GameEntities.cpp.o.d
+++ b/build/CMakeFiles/MCC.dir/src/game/GameEntities.cpp.o.d
@@ -415,7 +415,9 @@ CMakeFiles/MCC.dir/src/game/GameEntities.cpp.o: \
  /usr/include/c++/14.1.1/iomanip \
  /usr/include/c++/14.1.1/bits/quoted_string.h \
  /usr/include/c++/14.1.1/codecvt /usr/include/c++/14.1.1/bits/fs_dir.h \
- /usr/include/c++/14.1.1/bits/fs_ops.h /usr/include/c++/14.1.1/chrono \
+ /usr/include/c++/14.1.1/bits/fs_ops.h \
+ /home/alexis/Documents/Mythical_Conquests_Chronicles/src/game/../../include/game/../manager/../game/../manager/../utils/include/utils.hpp \
+ /usr/include/c++/14.1.1/chrono \
  /home/alexis/Documents/Mythical_Conquests_Chronicles/src/game/../../include/game/../manager/../game/Map.hpp \
  /usr/include/c++/14.1.1/fstream \
  /usr/include/c++/14.1.1/x86_64-pc-linux-gnu/bits/basic_file.h \
diff --git a/build/CMakeFiles/MCC.dir/src/game/Map.cpp.o b/build/CMakeFiles/MCC.dir/src/game/Map.cpp.o
index aeb7d50738b4c93e69f600defe3d0f995e26d329..dc1a0f79e4c188a0fe41fcf109e3ac1f20dacc65 100644
Binary files a/build/CMakeFiles/MCC.dir/src/game/Map.cpp.o and b/build/CMakeFiles/MCC.dir/src/game/Map.cpp.o differ
diff --git a/build/CMakeFiles/MCC.dir/src/game/Map.cpp.o.d b/build/CMakeFiles/MCC.dir/src/game/Map.cpp.o.d
index be82b8ebab059be3b8459c7aa84c440c2e207fba..89e28bdcf987f1b9d0d9bed5ae95510aa956116d 100644
--- a/build/CMakeFiles/MCC.dir/src/game/Map.cpp.o.d
+++ b/build/CMakeFiles/MCC.dir/src/game/Map.cpp.o.d
@@ -401,6 +401,7 @@ CMakeFiles/MCC.dir/src/game/Map.cpp.o: \
  /usr/include/c++/14.1.1/bits/unique_ptr.h \
  /usr/include/c++/14.1.1/bits/fs_dir.h \
  /usr/include/c++/14.1.1/bits/fs_ops.h \
+ /home/alexis/Documents/Mythical_Conquests_Chronicles/src/game/../../include/game/../manager/../utils/include/utils.hpp \
  /home/alexis/Documents/Mythical_Conquests_Chronicles/src/game/../../include/game/../manager/WorldManager.hpp \
  /home/alexis/Documents/Mythical_Conquests_Chronicles/src/game/../../include/game/../manager/../utils/include/enum.hpp \
  /home/alexis/Documents/Mythical_Conquests_Chronicles/src/game/../../include/game/../manager/BodyFactory.hpp \
diff --git a/build/CMakeFiles/MCC.dir/src/manager/MenuManager.cpp.o b/build/CMakeFiles/MCC.dir/src/manager/MenuManager.cpp.o
index c697e4e07da1375b808a2b824b1ae2c4637bdb45..bbef8389d2b9627a03e4f98f3049458a3715c346 100644
Binary files a/build/CMakeFiles/MCC.dir/src/manager/MenuManager.cpp.o and b/build/CMakeFiles/MCC.dir/src/manager/MenuManager.cpp.o differ
diff --git a/build/CMakeFiles/MCC.dir/src/manager/MenuManager.cpp.o.d b/build/CMakeFiles/MCC.dir/src/manager/MenuManager.cpp.o.d
index ef8b058763819c127f1f844217046c9532192484..83062bfd947587673709694f99014d865978eda6 100644
--- a/build/CMakeFiles/MCC.dir/src/manager/MenuManager.cpp.o.d
+++ b/build/CMakeFiles/MCC.dir/src/manager/MenuManager.cpp.o.d
@@ -464,4 +464,5 @@ CMakeFiles/MCC.dir/src/manager/MenuManager.cpp.o: \
  /usr/include/c++/14.1.1/iomanip \
  /usr/include/c++/14.1.1/bits/quoted_string.h \
  /usr/include/c++/14.1.1/codecvt /usr/include/c++/14.1.1/bits/fs_dir.h \
- /usr/include/c++/14.1.1/bits/fs_ops.h
+ /usr/include/c++/14.1.1/bits/fs_ops.h \
+ /home/alexis/Documents/Mythical_Conquests_Chronicles/src/manager/../../include/manager/../utils/include/utils.hpp
diff --git a/build/CMakeFiles/MCC.dir/src/manager/WorldManager.cpp.o b/build/CMakeFiles/MCC.dir/src/manager/WorldManager.cpp.o
index dd5e4bbdaa112764d9e9dd5596f10fb6e03bcc8c..d8e70ccb490b5dbf4dd4576c9c0e7a7943a35668 100644
Binary files a/build/CMakeFiles/MCC.dir/src/manager/WorldManager.cpp.o and b/build/CMakeFiles/MCC.dir/src/manager/WorldManager.cpp.o differ
diff --git a/build/CMakeFiles/MCC.dir/src/manager/WorldManager.cpp.o.d b/build/CMakeFiles/MCC.dir/src/manager/WorldManager.cpp.o.d
index ec01caf587dfb96a8d9b057db43386b1d128a92f..6a8ffbf80324ceebb0226ace5c6df03acef34efa 100644
--- a/build/CMakeFiles/MCC.dir/src/manager/WorldManager.cpp.o.d
+++ b/build/CMakeFiles/MCC.dir/src/manager/WorldManager.cpp.o.d
@@ -414,7 +414,9 @@ CMakeFiles/MCC.dir/src/manager/WorldManager.cpp.o: \
  /usr/include/c++/14.1.1/iomanip \
  /usr/include/c++/14.1.1/bits/quoted_string.h \
  /usr/include/c++/14.1.1/codecvt /usr/include/c++/14.1.1/bits/fs_dir.h \
- /usr/include/c++/14.1.1/bits/fs_ops.h /usr/include/c++/14.1.1/chrono \
+ /usr/include/c++/14.1.1/bits/fs_ops.h \
+ /home/alexis/Documents/Mythical_Conquests_Chronicles/src/manager/../../include/manager/../game/../manager/../utils/include/utils.hpp \
+ /usr/include/c++/14.1.1/chrono \
  /home/alexis/Documents/Mythical_Conquests_Chronicles/src/manager/../../include/manager/../game/Map.hpp \
  /usr/include/c++/14.1.1/fstream \
  /usr/include/c++/14.1.1/x86_64-pc-linux-gnu/bits/basic_file.h \
diff --git a/build/MCC b/build/MCC
index 9cd87cd9b14cea630225856af53c209be75bd725..ef68e4100f33c8c29bd58872ba373029cfa76f29 100755
Binary files a/build/MCC and b/build/MCC differ
diff --git a/include/game/Game.hpp b/include/game/Game.hpp
index 56e88db24a6815b6bd312c732348124f02e638f3..ca46828d56477a39b96182010ee7c1ad89f01474 100644
--- a/include/game/Game.hpp
+++ b/include/game/Game.hpp
@@ -48,13 +48,19 @@ class Game
         bool isEffect(){return specialEffect;}
         bool isHost(){return host;}
         bool isOnline(){return online;}
+        string getLoadedSave(){
+            return loadedSave;
+        }
+        void setLoadedSave(string path){
+            this->loadedSave = path;
+        }
         float* getDeltaT();
-
+        void buildWorld();
+     
     private:
         void input();        
         void update();
         void render();
-
         void tick(double& lag,Uint32& previous);
         float deltaT;
         double fps;
@@ -73,7 +79,7 @@ class Game
         RenderManager* renderManager;
         MenuManager* menuManager;
         WorldManager* worldManager;
-
+        string loadedSave;
         State state = InMenu;
 
         Texture branches;
diff --git a/include/game/GameEntities.hpp b/include/game/GameEntities.hpp
index 4a7dee35ee43964c7ad38fd67dfc8290953af694..11f12be15998e73511048cc01782de3f2b5f7043 100644
--- a/include/game/GameEntities.hpp
+++ b/include/game/GameEntities.hpp
@@ -16,6 +16,7 @@
 // Librairies importées
 #include <algorithm>
 #include <memory>
+#include <math.h>
 
 using namespace std;
 
@@ -132,7 +133,7 @@ class Being : public Entity
 class Player : public Being
 {
     public:
-        Player(float x, float y, b2Shape* shape, WorldManager* parent);
+        Player(float x, float y, int lvl,b2Shape* shape, WorldManager* parent);
 
         /**
          * @brief Basiquement la logique de l'ennemi.
@@ -147,7 +148,7 @@ class Player : public Being
         void getHit(STypeInstance* instance);
         void setState(EntityState state){this->state = state;}
         void setId(short int id){this->id = id;}
-    
+        void gainXp(int exp);
         short int getId(){return id;}
         int getWidthArrow(){return widthArrow;}
         int getHeightArrow(){return heightArrow;}
@@ -178,8 +179,10 @@ class Player : public Being
         bool invicible = false;
 
         //Stats spécifiques au joueur.
+        int niveau;
         int exp;
         int strength;
+        int capExp;
         int magic;
         int dexterity;
         int luck;
@@ -234,7 +237,7 @@ class Projectile : public Entity,public enable_shared_from_this<Projectile> {
 class Enemy : public Being
 {
     public:
-        Enemy(float x, float y, int w, int h, b2Shape* shape, WorldManager* parent);
+        Enemy(float x, float y, int w, int h,int expGift, b2Shape* shape, WorldManager* parent);
         
         void update(float deltaT) override;
         void onTouch(b2Contact* contact,float deltaT) override;
@@ -311,11 +314,12 @@ class Enemy : public Being
         ObstacleRayCastCallBack rayCastCallback;
         bool collide=false;
         bool active = true;
+        int expGift;
 };
 
 class Skeleton : public Enemy {
     public: 
-        Skeleton(float x, float y, int w, int h, b2Shape* shape, WorldManager* parent);
+        Skeleton(float x, float y, int w, int h,int expGift, b2Shape* shape, WorldManager* parent);
 
         void update(float deltaT) override;
 
@@ -325,7 +329,7 @@ class Skeleton : public Enemy {
 
 class SkeletonArcher : public Enemy {
     public: 
-        SkeletonArcher(float x, float y, int w, int h, b2Shape* shape, WorldManager* parent);
+        SkeletonArcher(float x, float y, int w, int h,int expGift, b2Shape* shape, WorldManager* parent);
 
         void update(float deltaT) override;
     
@@ -335,7 +339,7 @@ class SkeletonArcher : public Enemy {
 
 class SkeletonSpearman : public Enemy {
     public: 
-        SkeletonSpearman(float x, float y, int w, int h, b2Shape* shape, WorldManager* parent);
+        SkeletonSpearman(float x, float y, int w, int h,int expGift, b2Shape* shape, WorldManager* parent);
         void update(float deltaT) override;
 
     private:
@@ -469,9 +473,9 @@ class EntityFactory {
         static EntityFactory& getInstance(WorldManager* parent);
         static EntityFactory& getInstance();
 
-        void makePlayer(float x,float y);
-        void makeSkeleton(float x,float y,float w,float h);
-        void makeArcherSkeleton(float x,float y,float w,float h);
+        void makePlayer(float x,float y,int lvl);
+        void makeSkeleton(float x,float y,float w,float h,int playerLvl);
+        void makeArcherSkeleton(float x,float y,float w,float h,int playerLvl);
         void makeProjectile(float x,float y,float vX,float vY,float angle);
         
     protected:
diff --git a/include/manager/MenuManager.hpp b/include/manager/MenuManager.hpp
index 4b3377f6e4376cb541a3a91e0cc759c5fa6462b3..b178f06e228e0b018a9b2ca688d089b6a931d295 100644
--- a/include/manager/MenuManager.hpp
+++ b/include/manager/MenuManager.hpp
@@ -7,6 +7,7 @@
 #include "../game/Game.hpp"
 #include "./NetworkManager.hpp"
 #include <filesystem>
+#include "../utils/include/utils.hpp"
 class Game;
 
 class MenuManager : public IActor
@@ -23,7 +24,7 @@ class MenuManager : public IActor
         void Options();
         void displayQrCode();
         void loadingScreen();
-
+        string getTitleFromFile(std::filesystem::path filePath);
         RenderManager* renderManager;
         Texture background;
         struct nk_context *ctx;
diff --git a/include/manager/NetworkManager.hpp b/include/manager/NetworkManager.hpp
index 9dab365929c19086cfae90c60387f4d1b2ebf181..14de45facd57de21e4c2110bceb0843da4863b81 100644
--- a/include/manager/NetworkManager.hpp
+++ b/include/manager/NetworkManager.hpp
@@ -83,7 +83,7 @@ class NetworkManager
         static NetworkManager* instance;
         TCPsocket applicationServer = NULL;
         TCPsocket applicationClient = NULL;
-        TCPsocket applicationTmp =NULL;
+        TCPsocket applicationTmp = NULL;
         string applicationAddress;
         int applicationPort;
         SDLNet_SocketSet clientSet;
diff --git a/include/manager/WorldManager.hpp b/include/manager/WorldManager.hpp
index f39981fc379ac3733f4830741532431aa2863127..f5fe91552f7ceab13da7048c0f98e353921d036e 100644
--- a/include/manager/WorldManager.hpp
+++ b/include/manager/WorldManager.hpp
@@ -49,6 +49,7 @@ class WorldManager : public IActor
         void destroyBody(b2Body* body);
         void renderProjectiles();
         void makeProjectile(float x, float y,float vX,float vY,float angle);
+        void buildWorld();
 
         Player* getClosestPlayer(Entity* entity);
         Enemy* getClosestEnemy(Entity* entity);
@@ -91,7 +92,7 @@ class WorldManager : public IActor
         void renderDirectionArrow();
         void chatBox();
         void server();
-
+        void parseSave();
         Vec2 centerTextureOnHitBox(Entity* entity, const Vec2& coordonnees, Animation& animation);
 
         std::vector<std::string> messages;
@@ -103,7 +104,7 @@ class WorldManager : public IActor
         struct nk_context* ctx;
         int yMouse;
         int xMouse;
-
+        int lvlGame;
         Game* game;
         RenderManager* renderManager;
         EntityFactory* entityFactory;
diff --git a/include/utils/include/utils.hpp b/include/utils/include/utils.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..e83bcc9a8b4220b285b38b604035ad5cc255a435
--- /dev/null
+++ b/include/utils/include/utils.hpp
@@ -0,0 +1,13 @@
+vector<string> getSplitString(string token,char delimiter){
+    vector<string> tokens; 
+     stringstream ss(token); 
+    while (getline(ss, token, delimiter)) { 
+        tokens.push_back(token); 
+    } 
+    return tokens;
+}
+bool is_number(const std::string& s)
+{
+    return !s.empty() && std::find_if(s.begin(), 
+        s.end(), [](unsigned char c) { return !std::isdigit(c); }) == s.end();
+}
\ No newline at end of file
diff --git a/save/test1.save b/save/test1.save
new file mode 100644
index 0000000000000000000000000000000000000000..1943ab6a481d54c6f284e820d2edb724692ac963
--- /dev/null
+++ b/save/test1.save
@@ -0,0 +1,2 @@
+nom:nokzs
+niveau:30
\ No newline at end of file
diff --git a/src/game/Game.cpp b/src/game/Game.cpp
index 8a77e62f94a5c93eaf00e394c8ae21905450a070..c73b6f3324a03562ff90ba96304b85404c9b76e1 100644
--- a/src/game/Game.cpp
+++ b/src/game/Game.cpp
@@ -30,7 +30,9 @@ Game::~Game(){
 float* Game::getDeltaT(){
     return &deltaT;
 }
-
+void Game::buildWorld(){
+   worldManager->buildWorld();
+}
 void Game::gameLoop()
 {
     Uint32 previous = SDL_GetTicks();
diff --git a/src/game/GameEntities.cpp b/src/game/GameEntities.cpp
index d75faa0952b57c991ec99530a81b6a7cbef61983..c079a31a06b461771ecc48cf85d6bb7ca165fc74 100644
--- a/src/game/GameEntities.cpp
+++ b/src/game/GameEntities.cpp
@@ -13,7 +13,7 @@ Being::Being(float x,float y, float w, float h,float d, float f,float r,b2Shape*
  * Ici on gère les fonctions du joueur.
  */
 
-Player::Player(float x, float y, b2Shape* shape, WorldManager* parent) : Being(x, y, PLAYERSIZE_W / PPM, PLAYERSIZE_H / PPM, 10.0f, 1.0f,0.0f, shape, Dynamic,this,PLAYERCATEGORY,PLAYERTYPE,PLAYERINDEX,parent)
+Player::Player(float x, float y, int lvl,b2Shape* shape, WorldManager* parent) : Being(x, y, PLAYERSIZE_W / PPM, PLAYERSIZE_H / PPM, 10.0f, 1.0f,0.0f, shape, Dynamic,this,PLAYERCATEGORY,PLAYERTYPE,PLAYERINDEX,parent)
 {
     skills[HSlashSkill] = std::make_unique<HSlash>(this,world);
     this->parent = parent;
@@ -21,6 +21,7 @@ Player::Player(float x, float y, b2Shape* shape, WorldManager* parent) : Being(x
     this->currHp = 100;
     this->maxHp = 100;
     this->acceleration = 1.7f;
+    this->niveau = lvl;
 
     /* [Ajout de textures pour le joueur] --------------------------------------------------------------------- 
      * Étant donné que l'énum BeingState associe une énumération à un nombre.
@@ -80,7 +81,14 @@ void Player::update(float deltaT)
 
 
 }
-
+void Player::gainXp(int exp){
+    this->exp+=exp;
+    if(this->exp > this->capExp){
+        exp -= capExp;
+        this->niveau ++;
+        capExp= 100 *pow((niveau*2),1.5);
+    }
+}
 void Player::onTouch(b2Contact* contact,float deltaT)
 {
     //cout << "J'ai touché " << endl;
@@ -163,7 +171,7 @@ void Player::EndContact(b2Contact* contact,float deltaT) {
  * Ici on gère les fonctions de l'ennemi.
  */
 
-Enemy::Enemy(float x, float y, int w, int h, b2Shape* shape, WorldManager* parent) : Being(x, y, w / PPM, h / PPM, 1.0f, 1.0f,0.0f, shape, Dynamic,this,ENNEMYCATEGORY,ENEMYTYPE,ENEMYINDEX,parent){
+Enemy::Enemy(float x, float y, int w, int h,int expGift, b2Shape* shape, WorldManager* parent) : Being(x, y, w / PPM, h / PPM, 1.0f, 1.0f,0.0f, shape, Dynamic,this,ENNEMYCATEGORY,ENEMYTYPE,ENEMYINDEX,parent){
     this->parent = parent;
     this->world = parent->getWorld();
 
@@ -180,7 +188,7 @@ Enemy::Enemy(float x, float y, int w, int h, b2Shape* shape, WorldManager* paren
     b2CircleShape sensorPlayer;
     sensorPlayer.m_p.Set(getBody()->GetLocalCenter().x,getBody()->GetLocalCenter().y);
     sensorPlayer.m_radius = 6.0f;
-    
+    this->expGift = expGift;
     BodyFactory::getInstance().addSensor(this->getBody(),0.0f,1.0f,&sensorPlayer,PLAYERCATEGORY,this,TARGETTYPE,ENEMYINDEX);
     BodyFactory::getInstance().addSensor(this->getBody(),0.0f,1.0f,shape,PLAYERCATEGORY,this,KNOCKBACKTYPE,ENEMYINDEX);
 }
@@ -320,7 +328,7 @@ void Enemy::onTouch(b2Contact* contact,float deltaT){
 
 // NB : Comme il y aura plusieurs classes d'ennemis, faire un vector de pointeurs intelligents.
 
-Skeleton::Skeleton(float x, float y, int w, int h, b2Shape* shape, WorldManager* parent) : Enemy(x, y, w, h, shape, parent){
+Skeleton::Skeleton(float x, float y, int w, int h,int xpGift, b2Shape* shape, WorldManager* parent) : Enemy(x, y, w, h,xpGift,shape, parent){
     currHp = 100;
     maxHp = 100;
     armor = 0;
@@ -454,7 +462,7 @@ void Skeleton::update(float deltaT){
 
 // [SkeletonArcher] ----------------------------------------------------------------------------------------------
 
-SkeletonArcher::SkeletonArcher(float x, float y, int w, int h, b2Shape* shape, WorldManager* parent) : Enemy(x, y, w, h, shape, parent) {
+SkeletonArcher::SkeletonArcher(float x, float y, int w, int h,int expGift, b2Shape* shape, WorldManager* parent) : Enemy(x, y, w, h,expGift, shape, parent) {
    currHp = 100;
     maxHp = 100;
     armor = 0;
@@ -552,7 +560,7 @@ void SkeletonArcher::update(float deltaT){
 
 // [SkeletonSpearman] ----------------------------------------------------------------------------------------------
 
-SkeletonSpearman::SkeletonSpearman(float x, float y, int w, int h, b2Shape* shape, WorldManager* parent) : Enemy(x, y, w, h, shape, parent) {
+SkeletonSpearman::SkeletonSpearman(float x, float y, int w, int h,int expGift, b2Shape* shape, WorldManager* parent) : Enemy(x, y, w, h,expGift, shape, parent) {
 
 }
 
@@ -707,7 +715,7 @@ EntityFactory& EntityFactory::getInstance()
 }
 
 
-void EntityFactory::makeSkeleton(float x,float y,float w,float h){
+void EntityFactory::makeSkeleton(float x,float y,float w,float h,int playerLvl){
     b2PolygonShape eshape;
     const float enemySize_w = PLAYERSIZE_W / PPM;
     const float enemySize_h = PLAYERSIZE_H / PPM;
@@ -717,17 +725,19 @@ void EntityFactory::makeSkeleton(float x,float y,float w,float h){
         Vec2(enemySize_w/2.0f,enemySize_h/2.0f),
         0.0f
     );
+    int xpGift = playerLvl *100;
     std::shared_ptr<Enemy> skeleton = std::make_unique<Skeleton>(
         x,
         y,
         w,
         h,
+        xpGift,
         &eshape,
         parent
     );
     parent->getEnemies()->push_back(skeleton);
 }
-void EntityFactory::makeArcherSkeleton(float x,float y,float w,float h){
+void EntityFactory::makeArcherSkeleton(float x,float y,float w,float h,int playerLvl){
     b2PolygonShape eshape;
     const float enemySize_w = PLAYERSIZE_W / PPM;
     const float enemySize_h = PLAYERSIZE_H / PPM;
@@ -737,18 +747,20 @@ void EntityFactory::makeArcherSkeleton(float x,float y,float w,float h){
         Vec2(enemySize_w/2.0f,enemySize_h/2.0f),
         0.0f
     );
+    int xpGift = 100 * playerLvl;
     std::shared_ptr<Enemy> skeleton = std::make_unique<SkeletonArcher>(
         x,
         y,
         w,
         h,
+        xpGift,
         &eshape,
         parent
     );
     parent->getEnemies()->push_back(skeleton);
 }
 
-void EntityFactory::makePlayer(float x,float y){
+void EntityFactory::makePlayer(float x,float y,int lvl){
     const float playerWidth = PLAYERSIZE_W / PPM;
     const float playerHeigth = PLAYERSIZE_H / PPM;
     b2PolygonShape shape;
@@ -759,7 +771,7 @@ void EntityFactory::makePlayer(float x,float y){
         0.0f
     );
     string nomJoueurZero = "player";
-    parent->getPlayers()->emplace_back(x,y,&shape,parent);      
+    parent->getPlayers()->emplace_back(x,y,lvl,&shape,parent);      
 }
 
 void EntityFactory::makeProjectile(float x,float y,float vX,float vY,float angle){
diff --git a/src/manager/MenuManager.cpp b/src/manager/MenuManager.cpp
index a6f5a4491b123a270bddbd354416716b356af74a..803eafea12b0a3495812718c1ab04db0f77a27fc 100644
--- a/src/manager/MenuManager.cpp
+++ b/src/manager/MenuManager.cpp
@@ -48,6 +48,7 @@ void MenuManager::render(){
  * 
  */
 void MenuManager::menu(){
+   
     if (nk_begin(ctx, "Menu", nk_rect(
         (windowWidth - menu_width)/ 2, 
         (windowHeight - menu_height) / 2, 
@@ -55,6 +56,7 @@ void MenuManager::menu(){
         NK_WINDOW_BORDER |
         NK_WINDOW_NO_SCROLLBAR))
     {
+        string startGame = (game->getLoadedSave()=="" ? "Nouvelle partie" : "Reprendre la partie");
         float ratio[] = {0.1f, 0.80f,0.1f};
         int h = menu_height / 12;
         nk_layout_row(ctx, NK_DYNAMIC, h, 3, ratio);
@@ -62,8 +64,9 @@ void MenuManager::menu(){
         nk_spacer(ctx);nk_spacer(ctx);nk_spacer(ctx);
         
         nk_spacer(ctx);
-        if (nk_button_label(ctx, "Nouvelle Partie")) {
+        if (nk_button_label(ctx, startGame.c_str())) {
             game->setState(InGame);
+            //game->buildWorld();
         }
         nk_spacer(ctx);
         
@@ -115,9 +118,7 @@ void MenuManager::menu(){
     }
     if(showQrCode){
         displayQrCode();
-    }
-   
-    
+    }  
 }
 void MenuManager::displayQrCode(){
     if (nk_begin_titled(ctx, "Qrcode", "Qrcode", nk_rect(
@@ -133,6 +134,42 @@ void MenuManager::displayQrCode(){
     }
     nk_end(ctx);
 }
+
+string MenuManager::getTitleFromFile(std::filesystem::path filePath){
+    std::ifstream file;
+    file.open(filePath.string());
+    string content;
+    string line;
+    while (getline(file, line)) { 
+        content.append(line); 
+        content.append("\n"); 
+    } 
+    
+    vector<string> tokens = getSplitString(content,'\n');
+    
+    vector<string> infoPlayer; 
+    map<string, string> mp;
+  
+    for (string part : tokens) { 
+       vector<string> token = getSplitString(part,':');
+       cout << token[0] << ":" << token[1]<<endl;
+       if(token[0]!="nom" && !is_number(token[1])){
+        cout << "il y a un probleme" <<endl;  
+       }
+       string index = token[0];
+       string value = token[1];
+       mp[index]=value;
+
+    } 
+
+    string saveName;
+    saveName.append(mp["nom"]);
+    saveName.append("   ");
+    saveName.append("lvl");
+    saveName.append(mp["niveau"]);
+    file.close(); 
+    return saveName;
+}
 void MenuManager::loadingScreen(){
     if (nk_begin_titled(ctx, "Chargement", "Chargement", nk_rect(
             (windowWidth - options_width) / 2, 
@@ -142,11 +179,22 @@ void MenuManager::loadingScreen(){
     )){
         float ratio[] = {0.5f, 0.5f};
         
-        std::string path = "./";
+        std::string path = "../save/";
         
         for (const auto & entry : std::filesystem::directory_iterator(path)){
         nk_layout_row_dynamic(ctx,50,1);
-        nk_button_label(ctx,"nokzs lvl2 16h32");
+        if(entry.path().extension().compare(".save")==0){
+            cout << "fichier" << endl;
+             string name = getTitleFromFile(entry.path());
+             if(name!=""){
+                if(nk_button_label(ctx,name.c_str())){
+                    game->setLoadedSave(entry.path().string());
+                    showLoadingSave = false;
+                };
+             }
+
+        }
+        //ouvrir un fichier et renvoie une string contenant
        
         }
     }
diff --git a/src/manager/WorldManager.cpp b/src/manager/WorldManager.cpp
index 5fb1ea923d590e4633faccebae95ac34720569a2..d4a900a3bdaad071f9f4823d761ff3445d46e8f7 100644
--- a/src/manager/WorldManager.cpp
+++ b/src/manager/WorldManager.cpp
@@ -16,25 +16,28 @@
  */
 WorldManager::WorldManager(Game* game) : game(game) { 
     initializeDefaultDatas();
+    buildWorld();
+}
+
+WorldManager::~WorldManager(){
+    world->~b2World();
+    factory->~BodyFactory();
+}
+void WorldManager::buildWorld(){
     initializePhysicalWorld();
     initializeCamera();
-    initializePlayer();
     mapWorld = new Map(camera);
     loadTest();
+    initializePlayer();
     // NB : Orienter en fonction de la souris.
     debounce[SDLK_g] = false;
     debounce[SDLK_1] = false;
 }
-
-WorldManager::~WorldManager(){
-    world->~b2World();
-    factory->~BodyFactory();
-}
-
 void WorldManager::initializeCamera(){
     camera = renderManager->getCamera();
     camera->h = windowHeight;
     camera->w = windowWidth;
+   
 }
 
 /**
@@ -72,19 +75,55 @@ void WorldManager::initializePhysicalWorld(){
     factory = &(BodyFactory::getInstance(world));
     entityFactory = &EntityFactory::getInstance(this);
 }
-
+void WorldManager::parseSave(){
+     std::ifstream file; 
+    file.open(game->getLoadedSave());
+    string content;
+    string line;
+    while (getline(file, line)) { 
+        content.append(line); 
+        content.append("\n"); 
+    } 
+    
+    vector<string> tokens = getSplitString(content,'\n');
+    
+    vector<string> infoPlayer; 
+    map<string, string> mp;
+  
+    for (string part : tokens) { 
+       vector<string> token = getSplitString(part,':');
+       cout << token[0] << ":" << token[1]<<endl;
+       if(token[0]!="nom" && !is_number(token[1])){
+        cout << "il y a un probleme" <<endl;  
+       }
+       string index = token[0];
+       string value = token[1];
+       mp[index]=value;
+    } 
+    //cout <<game->getLoadedSave() << endl ;
+     entityFactory->makePlayer(mapW/(2.0f*PPM),mapH/(2.0f*PPM),stoi(mp["niveau"])); 
+     this->lvlGame = stoi(mp["niveau"]);
+}
 /**
  * @brief On instancie le joueur du monde avec sa caméra.
  */
 void WorldManager::initializePlayer(){
-    camera = renderManager->getCamera();
-    camera->h = windowHeight;
-    camera->w = windowWidth;
-
-    entityFactory->makePlayer(mapW/(2.0f*PPM),mapH/(2.0f*PPM));
+    
+    if(game->getLoadedSave() == ""){
+        cout << "j'initialise le joueur au niveau 1" << endl;
+        entityFactory->makePlayer(mapW/(2.0f*PPM),mapH/(2.0f*PPM),1);
+        this->lvlGame = 1;
+        playerZero = &players.back();
+        velocity = playerZero->getVelocity();
+    }
+    else{
+        parseSave();
+    }
 
-    playerZero = &players.back();
-    velocity = playerZero->getVelocity();
+    Vec2 positionJ1 = playerZero->getBody()->GetPosition();
+    camera->x = max(min((positionJ1.x - (camera->w / PPM + playerZero->getWidth())/2),(float) ((mapW - camera->w) / PPM)), 0.0f);
+    camera->y = max(min((positionJ1.y - (camera->h / PPM + playerZero->getHeight())/2),(float) ((mapH - camera->h) / PPM)), 0.0f);
+    
 }   
 
 /**
@@ -866,16 +905,13 @@ void WorldManager::loadTest()
     const float playerWidth = PLAYERSIZE_W / PPM;
     const float playerHeigth = PLAYERSIZE_H / PPM;
     /* Instanciation des instances statiques du monde (comme le joueur) */
-    entityFactory->makePlayer(mapW/(2.0f*PPM),mapH/(2.0f*PPM));
-    //entityFactory->makeArcherSkeleton(3.0f,3.0f,playerWidth,playerHeigth);
+    entityFactory->makeArcherSkeleton(3.0f,3.0f,this->lvlGame,playerWidth,playerHeigth);
+    entityFactory->makeSkeleton(10.0f,10.0f,this->lvlGame,PLAYERSIZE/PPM,PLAYERSIZE/PPM);
 
-    playerZero = &players.back();
-    velocity = playerZero->getVelocity();
-    
-    entityFactory->makeSkeleton(10.0f,10.0f,PLAYERSIZE/PPM,PLAYERSIZE/PPM);
-    Vec2 positionJ1 = playerZero->getBody()->GetPosition();
-    camera->x = max(min((positionJ1.x - (camera->w / PPM - playerZero->getWidth())/2),(float) ((mapW - camera->w) / PPM)), 0.0f);
-    camera->y = max(min((positionJ1.y - (camera->h / PPM - playerZero->getHeight())/2),(float) ((mapH - camera->h) / PPM)), 0.0f);
+   /* playerZero = &players.back();
+    entityFactory->makePlayer(mapW/(2.0f*PPM),mapH/(2.0f*PPM),1);
+    velocity = playerZero->getVelocity();*/
+   
 }
 
 /**