resolved merge changes
authorstian853 <stian853@su15-110.ad.liu.se>
Wed, 6 Dec 2023 13:47:10 +0000 (14:47 +0100)
committerstian853 <stian853@su15-110.ad.liu.se>
Wed, 6 Dec 2023 13:47:10 +0000 (14:47 +0100)
1  2 
assets/data.json
src/States.cc
src/States.h

index 635963fe688e164b1c2ca5b92e160afdbb0e60d0,7044c14b0c7bf158a03f5830ddb5e1aa0d1a05cc..94064f131bef58f925c1fecdebdba90f0a4b7b54
      },
      "game_constants":
      {
-         "bottles_per_second" : 1,
-         "game_time" : 60,
-         "yf_per_second": 0.125,
-         "bikes_per_second": 0.25,
          "scoreboard" : 5,
 -        "bikes_per_second": 0.17
+         "bottles_per_second" : 2,
+         "game_time" : 2,
+         "yf_per_second": 0.125,
-         
++        "bikes_per_second": 0.17,
 +        "point_scale_div": 3.0
      },
      "map":
      {
  
      "bike_enemy":
      {
 -        "scale" : [0.3, 0.3],
 -        "max_speed" : 3.0,
 -        "direction": [0, 1]
 -
 +        "scale" : [0.25, 0.25],
 +        "max_speed" : 5.0,
 +        "direction": [0, 1],
 +        "sin_amplitude": 50,
 +        "sin_omega": 5
 +    },
 +    "game_state_assets":
 +    {
 +        "kir_file": "assets/kir.png",
 +        "YF_file": "assets/YF.png",
 +        "cyklist_file": "assets/cyklist.png",
 +        "ling_file": "assets/6Ling_figur2.png",
 +        "sack_file": "assets/sack.png",
 +        "player_file": "assets/4V_figur.png",
 +        "helper_file": "assets/ysex.png",
 +        "map_file": "assets/bakgrund.png"
+     },
+     "gameover_menu":
+     {
+         "scoreboard" : 5,
+         "texture": "assets/game_over.png",
+         "font" : "assets/fonts/Philosopher-Regular.ttf",
+         "highscore_file": "assets/highscore.csv"
+     },
+     "pause_menu":
+     {
+         "texture": "assets/Pause_bild.png",
+         "texture_mouse" : "assets/muspekareGul.png",
+         "font": "assets/fonts/Philosopher-Regular.ttf"
+     },
+     "scoreboard_menu": 
+     {
+         "texture": "assets/scoreboard.png",
+         "texture_mouse" : "assets/muspekareGul.png",
+         "font": "assets/fonts/Philosopher-Regular.ttf",
+         "highscore_file": "assets/highscore.csv"
+     },
+     "start_menu":
+     {
+      "texture": "assets/meny_bild.png",
+      "texture_mouse" : "assets/muspekareGul.png",
+      "font": "assets/fonts/Philosopher-Regular.ttf"     
      }
  
  }
diff --cc src/States.cc
index 9129afd0401f50878928f987ebe9c984d7cbd697,d7a702187ae3f815bc1ce900119bc8e848661062..10e7e8a14e3b5148aaeb3e044add0f82ca38c9f2
@@@ -75,10 -65,10 +76,10 @@@ void Game_state::update(Context &contex
      int remaining_time {static_cast<int>(data["game_constants"]["game_time"]) - static_cast<int>(game_time)};
      if (remaining_time < 0)
      {
-         context.next_state = std::make_unique<GameOver_menu>();
+         context.next_state = std::make_unique<GameOver_menu>(points, data);
          return;
      }
 - 
 +    
  
      for (unsigned int i {0}; i < bottles.size(); ++i)
      {
diff --cc src/States.h
index 5e4a7543957b7b294c1e6a734c06193e0332b805,63737fea781cad484e7338843e05d2489c15246b..4cf7aae06f9af8c6ef7b9bf5c6855a7fb33e67cd
@@@ -54,10 -57,9 +55,8 @@@ private
  
      bool pause_game;
      sf::Texture bottle_texture;
 -    sf::Texture main_enemy_texture;
      sf::Texture YF_texture;
      sf::Texture bike_texture;
-     //std::vector<std::unique_ptr<YF>> yf;
-     
      json data;
      int points;
  };