fixed random seed
authorlukel495 <lukel495@su00-102.ad.liu.se>
Thu, 23 Nov 2023 10:48:00 +0000 (11:48 +0100)
committerlukel495 <lukel495@su00-102.ad.liu.se>
Thu, 23 Nov 2023 10:48:00 +0000 (11:48 +0100)
src/_main.cc

index 0808a0581707a9d760f92ce1e618a861e68a70ce..913a5bbfc158e4e71b13586d69259739d1e2d64c 100644 (file)
@@ -7,6 +7,7 @@
 #include <SFML/Graphics.hpp>
 #include <iostream>
 #include <memory>
+#include <random>
 
 #include "constants.h"
 #include "States.h"
@@ -50,6 +51,8 @@ int main ()
             game_context.current_state.release();
             game_context.current_state = std::move(game_context.next_state);
             game_context.next_state = nullptr;
+
+            srand(game_clock.getElapsedTime().asMicroseconds());
         }
 
         //Draw