From: stian853 Date: Wed, 6 Dec 2023 13:47:10 +0000 (+0100) Subject: resolved merge changes X-Git-Url: https://gitweb.forssennils.se/?a=commitdiff_plain;h=0e355ccbc9e1fb38439cf5ca674f56dcb7b4ee52;p=TDDC76_proj.git resolved merge changes --- 0e355ccbc9e1fb38439cf5ca674f56dcb7b4ee52 diff --cc assets/data.json index 635963f,7044c14..94064f1 --- a/assets/data.json +++ b/assets/data.json @@@ -28,13 -28,11 +28,12 @@@ }, "game_constants": { - "bottles_per_second" : 1, - "game_time" : 60, - "yf_per_second": 0.125, - "bikes_per_second": 0.25, "scoreboard" : 5, + "bottles_per_second" : 2, + "game_time" : 2, + "yf_per_second": 0.125, - "bikes_per_second": 0.17 ++ "bikes_per_second": 0.17, + "point_scale_div": 3.0 - }, "map": { @@@ -61,22 -55,37 +60,49 @@@ "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 9129afd,d7a7021..10e7e8a --- a/src/States.cc +++ b/src/States.cc @@@ -75,10 -65,10 +76,10 @@@ void Game_state::update(Context &contex int remaining_time {static_cast(data["game_constants"]["game_time"]) - static_cast(game_time)}; if (remaining_time < 0) { - context.next_state = std::make_unique(); + context.next_state = std::make_unique(points, data); return; } - + for (unsigned int i {0}; i < bottles.size(); ++i) { diff --cc src/States.h index 5e4a754,63737fe..4cf7aae --- a/src/States.h +++ b/src/States.h @@@ -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> yf; - json data; int points; };