diff --git a/assets/.goutputstream-WLDR82 b/assets/.goutputstream-WLDR82 new file mode 100644 index 00000000..de57b373 Binary files /dev/null and b/assets/.goutputstream-WLDR82 differ diff --git a/assets/PARAFLOR-01[1].png b/assets/PARAFLOR-01[1].png new file mode 100644 index 00000000..6be3d157 Binary files /dev/null and b/assets/PARAFLOR-01[1].png differ diff --git a/assets/gfx/guns/bomb_hub.xcf b/assets/gfx/guns/bomb_hub.xcf new file mode 100644 index 00000000..12fd1383 Binary files /dev/null and b/assets/gfx/guns/bomb_hub.xcf differ diff --git a/assets/gfx/guns/guns.xcf b/assets/gfx/guns/guns.xcf index dae82286..85c9e9a9 100644 Binary files a/assets/gfx/guns/guns.xcf and b/assets/gfx/guns/guns.xcf differ diff --git a/assets/gfx/hud/guns_inventory.xcf b/assets/gfx/hud/guns_inventory.xcf index f65dc53e..f82bdb40 100644 Binary files a/assets/gfx/hud/guns_inventory.xcf and b/assets/gfx/hud/guns_inventory.xcf differ diff --git a/assets/gfx/listTeams/rusty-black.png b/assets/gfx/listTeams/rusty-black.png new file mode 100644 index 00000000..a6479e51 Binary files /dev/null and b/assets/gfx/listTeams/rusty-black.png differ diff --git a/client/gui/hud_component/hud_display.cpp b/client/gui/hud_component/hud_display.cpp index 4aa88b40..4d849d15 100644 --- a/client/gui/hud_component/hud_display.cpp +++ b/client/gui/hud_component/hud_display.cpp @@ -58,5 +58,5 @@ void SdlHud::update_pointer_position(int x, int y) { pointer_component->update_p bool SdlHud::start_game_click(int x, int y) { return controls_component->start_game_click(x, y); } - +void SdlHud::update_winner(Team t) { scores_component->update__winner_score(t); } void SdlHud::update_mute_icon() { scores_component->update_mute_icon(); } diff --git a/client/gui/hud_component/hud_display.h b/client/gui/hud_component/hud_display.h index a535fb57..ec099077 100644 --- a/client/gui/hud_component/hud_display.h +++ b/client/gui/hud_component/hud_display.h @@ -50,6 +50,7 @@ class SdlHud { void update_pointer_position(int x, int y); void update_mute_icon(); bool start_game_click(int x, int y); + void update_winner(Team winner); private: void initialize_layout(); diff --git a/client/gui/hud_component/hud_scores.cpp b/client/gui/hud_component/hud_scores.cpp index 769373ba..fd17578b 100644 --- a/client/gui/hud_component/hud_scores.cpp +++ b/client/gui/hud_component/hud_scores.cpp @@ -49,7 +49,7 @@ void HudScores::render_team_scores() { paral_height); parallelogram_blue.render(src_parallelogram1, dest_parallelogram1); - score_text.setTextString(std::to_string(0)); // TODO : Replace with actual score + score_text.setTextString(std::to_string(score_ct)); // TODO : Replace with actual score score_text.render(Area(trapecio_x - paral_width / 4 + margin * 6, layout.padding * 3, layout.size_width / 1.75, layout.size_height / 2)); @@ -59,7 +59,7 @@ void HudScores::render_team_scores() { paral_height); parallelogram_red.render(src_parallelogram, dest_parallelogram); - score_text.setTextString(std::to_string(0)); // TODO : Replace with actual score + score_text.setTextString(std::to_string(score_tt)); // TODO : Replace with actual score score_text.render( Area(trapecio_x + trapecio_width + margin + paral_width / 2 - layout.size_width / 4, layout.padding * 3, layout.size_width / 1.75, layout.size_height / 2)); @@ -83,3 +83,11 @@ void HudScores::render_mute_icon() { } void HudScores::update_mute_icon() { is_muted = !is_muted; } + +void HudScores::update__winner_score(Team winner) { + if (winner == Team::CT) { + score_ct++; + } else if (winner == Team::TT) { + score_tt++; + } +} diff --git a/client/gui/hud_component/hud_scores.h b/client/gui/hud_component/hud_scores.h index 2f61df79..1fb725c4 100644 --- a/client/gui/hud_component/hud_scores.h +++ b/client/gui/hud_component/hud_scores.h @@ -18,12 +18,15 @@ class HudScores { SdlTexture parallelogram_red; const HudLayout& layout; bool is_muted = false; + int score_ct = 0; + int score_tt = 0; public: explicit HudScores(SdlWindow& window, const HudLayout& layout); void render(const GameUpdate& state); void render_mute_icon(); void update_mute_icon(); + void update__winner_score(Team winner); private: void render_background(); diff --git a/client/gui/map_view/sdl_world_item.cpp b/client/gui/map_view/sdl_world_item.cpp index 5ae4f627..d1b89282 100644 --- a/client/gui/map_view/sdl_world_item.cpp +++ b/client/gui/map_view/sdl_world_item.cpp @@ -15,26 +15,28 @@ void SdlWorldItem::render() { if (game_state.get_bomb().has_value()) { const auto& bomb = game_state.get_bomb().value(); Vector2D pos = bomb.hitbox.get_pos(); + double angle = bomb.hitbox.get_rotation_deg(); Area origin(0, 0, 24, 24); Vector2D pos_cam = camera.get_screen_pos(pos); Area dest(pos_cam.get_x(), pos_cam.get_y(), 32, 32); if (camera.can_see(pos_cam)) - bomb_t.render(origin, dest); + bomb_t.render(origin, dest, angle); } for (const auto& [gun_type, gun_item]: // cppcheck-suppress[unassignedVariable] game_state.get_dropped_guns()) { Vector2D pos = gun_item.get_pos(); + float angle = gun_item.get_rotation_deg(); if (!camera.can_see(pos)) return; Vector2D pos_cam = camera.get_screen_pos(pos); Area dest(pos_cam.get_x(), pos_cam.get_y(), 32, 32); Area origin(10, 0, 54, 32); if (gun_type == GunType::AWP) { - awp_t.render(origin, dest); + awp_t.render(origin, dest, angle); } else if (gun_type == GunType::M3) { - m3_t.render(origin, dest); + m3_t.render(origin, dest, angle); } else if (gun_type == GunType::AK47) { - ak_t.render(origin, dest); + ak_t.render(origin, dest, angle); } } } diff --git a/client/gui/pre_game_view/list_skins.cpp b/client/gui/pre_game_view/list_skins.cpp index 8a22304b..5cdee6ef 100644 --- a/client/gui/pre_game_view/list_skins.cpp +++ b/client/gui/pre_game_view/list_skins.cpp @@ -20,9 +20,19 @@ skinSelect::skinSelect(SdlWindow& window, const GameUpdate& state, const std::st background(BACKGROUND1_PATH, window), skins_tt(SKIN_PATHS_TT, window), skins_ct(SKIN_PATHS_CT, window), + skin_labels{{SdlText(TEXT1_PATH, 100, {255, 255, 255, 255}, window), + SdlText(TEXT1_PATH, 100, {255, 255, 255, 255}, window), + SdlText(TEXT1_PATH, 100, {255, 255, 255, 255}, window), + SdlText(TEXT1_PATH, 100, {255, 255, 255, 255}, window)}}, selected_skin(-1), active(true) { + + for (int i = 0; i < 4; ++i) { + skin_labels[i].setTextString("Skin " + std::to_string(i + 1)); + } + + float BASE_WIDTH = 800.0f; float BASE_HEIGHT = 600.0f; @@ -91,10 +101,8 @@ void skinSelect::renderSkins() { SDL_RenderDrawRect(window.getRenderer(), &highlight); } - // Draw skin label - text.setTextString("Skin " + std::to_string(i + 1)); Area label_area(x + 10, y + slot_height + 10, 100, 30); - text.render(label_area); + skin_labels[i].render(label_area); } } diff --git a/client/gui/pre_game_view/list_skins.h b/client/gui/pre_game_view/list_skins.h index 2604f2d2..491b3269 100644 --- a/client/gui/pre_game_view/list_skins.h +++ b/client/gui/pre_game_view/list_skins.h @@ -1,6 +1,7 @@ #pragma once #include +#include #include #include @@ -12,7 +13,6 @@ #include "common/commands.h" #include "common/message.h" #include "common/models.h" - class skinSelect { public: explicit skinSelect(SdlWindow& window, const GameUpdate& state, const std::string& player_name); @@ -36,6 +36,7 @@ class skinSelect { SdlTexture background; SdlTexture skins_tt; SdlTexture skins_ct; + std::array skin_labels; float widthRatio, heightRatio, scaleRatio; float slot_width, slot_height; diff --git a/client/gui/pre_game_view/list_teams.cpp b/client/gui/pre_game_view/list_teams.cpp index 187792a3..baaa4e68 100644 --- a/client/gui/pre_game_view/list_teams.cpp +++ b/client/gui/pre_game_view/list_teams.cpp @@ -21,6 +21,14 @@ listTeams::listTeams(SdlWindow& window, const GameUpdate& state, const std::stri DISPLAY_HEIGHT(window.getHeight()), text(TEXT_PATH, 100, {255, 255, 255, 255}, window), smaller_text(SMALLER_TEXT_PATH, 100, {255, 255, 255, 255}, window), + team_labels{{SdlText(TEXT_PATH, 100, {255, 255, 255, 255}, window), + SdlText(TEXT_PATH, 100, {255, 255, 255, 255}, window)}}, + tt_descriptions{SdlText(SMALLER_TEXT_PATH, 100, {255, 255, 255, 255}, window), + SdlText(SMALLER_TEXT_PATH, 100, {255, 255, 255, 255}, window), + SdlText(SMALLER_TEXT_PATH, 100, {255, 255, 255, 255}, window)}, + ct_descriptions{SdlText(SMALLER_TEXT_PATH, 100, {255, 255, 255, 255}, window), + SdlText(SMALLER_TEXT_PATH, 100, {255, 255, 255, 255}, window), + SdlText(SMALLER_TEXT_PATH, 100, {255, 255, 255, 255}, window)}, rectangulo_horizontal(RECTANGULE_HORIZONTAL, window), background(BACKGROUND_PATH_1, window), terrorist(TERRORIST_PATH, window), @@ -54,8 +62,22 @@ listTeams::listTeams(SdlWindow& window, const GameUpdate& state, const std::stri select_skin_height = 50 * heightRatio; select_skin_x = DISPLAY_WIDTH - select_skin_width - padding * 4; select_skin_y = padding * 4; + // Set preloaded labels + team_labels[0].setTextString("Terrorist"); + team_labels[1].setTextString("Counter-Terrorist"); + + // Set TT descriptions + tt_descriptions[0].setTextString("Plant the bomb and defend it until "); + tt_descriptions[1].setTextString("it explodes, or eliminate all "); + tt_descriptions[2].setTextString("Counter-Terrorists to secure victory."); + + // Set CT descriptions + ct_descriptions[0].setTextString("Prevent the terrorist from "); + ct_descriptions[1].setTextString("detonating their bomb or "); + ct_descriptions[2].setTextString("eliminate them all to win."); } + void listTeams::render() { if (active) { Area src(0, 0, 250, 250); @@ -101,58 +123,32 @@ void listTeams::renderSlots() { Area terrorist_dest(terrorist_x, terrorist_y, slot_width, slot_height); Area counter_terrorist_dest(counter_terrorist_x, counter_terrorist_y, slot_width, slot_height); - // Render the terrorist and counter-terrorist images terrorist.render(src, terrorist_dest); counter_terrorist.render(src1, counter_terrorist_dest); - // Add text below the terrorist image - text.setTextString("Terrorist"); - Area terrorist_text_dest(terrorist_x + (size_slots_w) / 4, + Area terrorist_text_dest(terrorist_x + size_slots_w / 4, terrorist_y + DISPLAY_WIDTH * 0.30 - 50, 150, 50); - text.render(terrorist_text_dest); - - // Add text below the counter-terrorist image - text.setTextString("Counter-Terrorist"); - Area counter_terrorist_text_dest(counter_terrorist_x + (size_slots_w) / 4, - counter_terrorist_y + DISPLAY_WIDTH * 0.30 - 50, 200, 50); - text.render(counter_terrorist_text_dest); + team_labels[0].render(terrorist_text_dest); - int text_terrorist_y = terrorist_y + DISPLAY_WIDTH * 0.30; - int text_counter_terrorist_y = counter_terrorist_y + DISPLAY_WIDTH * 0.30; - int text_terrorist_x = terrorist_x + (size_slots_w) / 4; - int text_counter_terrorist_x = counter_terrorist_x + (size_slots_w) / 4; + Area counter_text_dest(counter_terrorist_x + size_slots_w / 4, + counter_terrorist_y + DISPLAY_WIDTH * 0.30 - 50, 200, 50); + team_labels[1].render(counter_text_dest); std::optional team_choosen = game_state.get_players().at(player_name).get_optional_team(); - if (team_choosen == Team::TT) { - smaller_text.setTextString("Plant the bomb and defend it until "); - Area terrorist_text_dest_1(text_terrorist_x + padding, text_terrorist_y, 400 * scale, 50); - smaller_text.render(terrorist_text_dest_1); - - smaller_text.setTextString("it explodes, or eliminate all "); - Area terrorist_text_dest_2(text_terrorist_x + padding, text_terrorist_y + padding * 3, - 400 * scale, 50); - smaller_text.render(terrorist_text_dest_2); - - smaller_text.setTextString("Counter-Terrorists to secure victory."); - Area terrorist_text_dest_3(text_terrorist_x + padding, text_terrorist_y + padding * 6, - 400 * scale, 50); - smaller_text.render(terrorist_text_dest_3); - } else { - smaller_text.setTextString("Prevent the terrorist from "); - Area counter_terrorist_text_dest_1(text_counter_terrorist_x + padding, - text_counter_terrorist_y, 400 * scale, 50); - smaller_text.render(counter_terrorist_text_dest_1); - - smaller_text.setTextString("detonating their bomb or "); - Area counter_terrorist_text_dest_2(text_counter_terrorist_x + padding, - text_counter_terrorist_y + padding * 3, 400 * scale, 50); - smaller_text.render(counter_terrorist_text_dest_2); - - smaller_text.setTextString("eliminate them all to win."); - Area counter_terrorist_text_dest_3(text_counter_terrorist_x + padding, - text_counter_terrorist_y + padding * 6, 400 * scale, 50); - smaller_text.render(counter_terrorist_text_dest_3); + int base_y_text = team_choosen == Team::TT ? terrorist_y + DISPLAY_WIDTH * 0.30 : + counter_terrorist_y + DISPLAY_WIDTH * 0.30; + + int base_x_text = team_choosen == Team::TT ? terrorist_x + size_slots_w / 4 : + counter_terrorist_x + size_slots_w / 4; + + for (int i = 0; i < 3; ++i) { + Area line_area(base_x_text + padding, base_y_text + padding * (i * 3), 400 * scale, 50); + if (team_choosen == Team::TT) { + tt_descriptions[i].render(line_area); + } else { + ct_descriptions[i].render(line_area); + } } } diff --git a/client/gui/pre_game_view/list_teams.h b/client/gui/pre_game_view/list_teams.h index 4b632091..a847c895 100644 --- a/client/gui/pre_game_view/list_teams.h +++ b/client/gui/pre_game_view/list_teams.h @@ -1,6 +1,7 @@ #ifndef LIST_TEAMS_H #define LIST_TEAMS_H +#include #include #include #include @@ -36,6 +37,11 @@ class listTeams { int base_y; SdlText text; SdlText smaller_text; + + std::array team_labels; + std::array tt_descriptions; + std::array ct_descriptions; + SdlTexture rectangulo_horizontal; SdlTexture background; SdlTexture terrorist; diff --git a/client/gui/shop_view/shop.cpp b/client/gui/shop_view/shop.cpp index be224dbd..c8925610 100644 --- a/client/gui/shop_view/shop.cpp +++ b/client/gui/shop_view/shop.cpp @@ -24,10 +24,10 @@ shopDisplay::shopDisplay(SdlWindow& window, const GameUpdate& state): gunNumber(std::string(GameConfig::Paths::FONT_PAT), 20, {255, 255, 255, 255}, window), gun_buy(-1), guns({{"1", "", "1000"}, {"2", "", "1500"}, {"3", "", "20"}}), - ammo({{"4", "", "200"}, - {"5", "", "300"}, - {"6", "", "400"}, - {"7", "", "500"}, + ammo({{"4", "AK47", "200"}, + {"5", "M3", "300"}, + {"6", "AWP", "400"}, + {"7", "Glock", "500"}, {"8", "", ""}}) { float BASE_WIDTH = 800.0f; @@ -171,10 +171,19 @@ void shopDisplay::renderItem() { Area iconDest(x + 30, y, size_guns_w - 60, size_guns_h + 10); ammo_icons.render(src, iconDest); + // ID number gunNumber.setTextString(ammo[i].id); Area numDest(x, y - 10, 15, 15); gunNumber.render(numDest); + // Gun name (new line) + if (!ammo[i].name.empty()) { + cost_money.setTextString(ammo[i].name); // You can use another font if needed + Area nameDest(x + 30, y + size_guns_h + 5, 100, 20); // Positioned under the icon + cost_money.render(nameDest); + } + + // Price if (ammo[i].price.empty()) { cost_money.setTextString("Not Available"); } else { diff --git a/client/gui/shop_view/shop.h b/client/gui/shop_view/shop.h index 956e9e90..f97042a0 100644 --- a/client/gui/shop_view/shop.h +++ b/client/gui/shop_view/shop.h @@ -43,6 +43,5 @@ class shopDisplay { std::vector ammo; // Moved ammo into the class void renderSlots(); void renderItem(); - void get_item_slots(int id_slot); }; #endif // SHOP_DISPLAY_H diff --git a/client/gui/window_elements/sdl_text.cpp b/client/gui/window_elements/sdl_text.cpp index ad6bceff..3e778254 100644 --- a/client/gui/window_elements/sdl_text.cpp +++ b/client/gui/window_elements/sdl_text.cpp @@ -49,11 +49,18 @@ SDL_Texture* SdlText::createTextureFromText(const std::string& text) { return newTexture; } -void SdlText::setTextString(const std::string& text) { - if (texture) { + +void SdlText::setTextString(const std::string& str) { + if (str == current_text) + return; // No change + current_text = str; + + if (texture) SDL_DestroyTexture(texture); - } - texture = createTextureFromText(text); + + SDL_Surface* surface = TTF_RenderText_Blended(font, current_text.c_str(), color); + texture = SDL_CreateTextureFromSurface(renderer, surface); + SDL_FreeSurface(surface); } int SdlText::render(const Area& dest) const { diff --git a/client/gui/window_elements/sdl_text.h b/client/gui/window_elements/sdl_text.h index 711c41a4..2887cb87 100644 --- a/client/gui/window_elements/sdl_text.h +++ b/client/gui/window_elements/sdl_text.h @@ -14,16 +14,16 @@ class SdlText { SDL_Renderer* renderer; SDL_Texture* texture; TTF_Font* font; + std::string current_text; SDL_Color color; - SDL_Texture* createTextureFromText(const std::string& text); - public: SdlText(const std::string& fontFile, int fontSize, SDL_Color color, const SdlWindow& window); ~SdlText(); void setTextString(const std::string& text); int render(const Area& dest) const; SDL_Texture* getText() const { return texture; } + SDL_Texture* createTextureFromText(const std::string& text); }; #endif // SDLTEXT_H diff --git a/client/gui/window_elements/sdl_texture.cpp b/client/gui/window_elements/sdl_texture.cpp index 8e68e6f9..d6325352 100644 --- a/client/gui/window_elements/sdl_texture.cpp +++ b/client/gui/window_elements/sdl_texture.cpp @@ -57,12 +57,24 @@ void SdlTexture::render(int x, int y, SDL_Rect* clip, double angle, SDL_Point* c void SdlTexture::render(int x, int y, double angle) { render(x, y, nullptr, angle); } + +void SdlTexture::render(const Area& src, const Area& dest, double angle) const { + SDL_Rect sdlSrc = {src.getX(), src.getY(), src.getWidth(), src.getHeight()}; + SDL_Rect sdlDest = {dest.getX(), dest.getY(), dest.getWidth(), dest.getHeight()}; + + if (SDL_RenderCopyEx(this->renderer, this->texture, &sdlSrc, &sdlDest, angle, nullptr, + SDL_FLIP_NONE) != 0) { + std::cout << "Render failed: " << SDL_GetError() << std::endl; + } +} + void SdlTexture::render(int x, int y, int w, int h, SDL_Rect* clip, double angle, SDL_Point* center, SDL_RendererFlip flip) { SDL_Rect renderQuad = {x, y, w, h}; if (SDL_RenderCopyEx(this->renderer, this->texture, clip, &renderQuad, angle, center, flip) != 0) { + std::cout << "Render failed: " << SDL_GetError() << std::endl; } } diff --git a/client/gui/window_elements/sdl_texture.h b/client/gui/window_elements/sdl_texture.h index 05d87521..cc8ee575 100644 --- a/client/gui/window_elements/sdl_texture.h +++ b/client/gui/window_elements/sdl_texture.h @@ -34,6 +34,7 @@ class SdlTexture { void render(int x, int y, double angle); void render(int x, int y, SDL_Rect* clip = nullptr, double angle = 0, SDL_Point* center = nullptr, SDL_RendererFlip flip = SDL_FLIP_NONE); + void render(const Area& src, const Area& dest, double angle) const; void render(int x, int y, int w, int h, SDL_Rect* clip, double angle, SDL_Point* center, SDL_RendererFlip flip); diff --git a/client/sdl_display.cpp b/client/sdl_display.cpp index 31aa1a8c..4fa0e8bf 100644 --- a/client/sdl_display.cpp +++ b/client/sdl_display.cpp @@ -31,6 +31,7 @@ SDLDisplay::SDLDisplay(Queue& input_queue, Queue& output_queue shop_display(nullptr), world(nullptr), end_round_display(nullptr), + hud_display(nullptr), sound_manager(), current_phase(PhaseType::WarmUp) { SCREEN_WIDTH = 1200; @@ -77,7 +78,7 @@ void SDLDisplay::run() { setup(); load_audio(); SdlWindow window(SCREEN_WIDTH, SCREEN_HEIGHT); - SdlHud hud_display(window, state, player_name); + hud_display = std::make_unique(window, state, player_name); shop_display = std::make_unique(window, state); Map map = get_map(); world = std::make_unique(window, std::move(map), state, player_name); @@ -88,9 +89,9 @@ void SDLDisplay::run() { input_handler = std::make_unique( quit_flag, MouseHandler(output_queue, SCREEN_WIDTH, SCREEN_HEIGHT, list_teams, *shop_display, - hud_display, list_skins), - KeyboardHandler(output_queue, *shop_display, *score_display, sound_manager, hud_display, - *world)); + *hud_display, list_skins), + KeyboardHandler(output_queue, *shop_display, *score_display, sound_manager, + *hud_display, *world)); end_round_display = std::make_unique(window, state); input_handler->start(); @@ -110,23 +111,23 @@ void SDLDisplay::run() { list_skins.render(); } else { world->render(); - hud_display.render(); + hud_display->render(); } } else if (state.get_phase().get_type() == PhaseType::Buying) { world->render(); - hud_display.render(); + hud_display->render(); shop_display->render(); } else if (state.get_phase().get_type() == PhaseType::InRound) { shop_display->updateShopState(false); world->render(); - hud_display.render(); + hud_display->render(); } else if (state.get_phase().get_type() == PhaseType::RoundEnd) { world->render(); - hud_display.render(); + hud_display->render(); end_round_display->render(); } else if (state.get_phase().get_type() == PhaseType::BombPlanted) { world->render(); - hud_display.render(); + hud_display->render(); } if (score_display->isActive()) { @@ -141,7 +142,7 @@ void SDLDisplay::run() { void SDLDisplay::load_audio() { sound_manager.load_music("menu", std::string(GameConfig::Paths::MENU_MUSIC_PATH).c_str()); sound_manager.load_music("background", std::string(GameConfig::Paths::GAME_MUSIC_PATH).c_str()); - sound_manager.set_volume(0.8f); + sound_manager.set_volume(0.5f); sound_manager.load_sound("ct_win", std::string(GameConfig::Paths::CT_WIN_SOUND_PATH).c_str()); sound_manager.load_sound("tt_win", std::string(GameConfig::Paths::TT_WIN_SOUND_PATH).c_str()); sound_manager.load_sound("item_pick", @@ -275,6 +276,7 @@ void SDLDisplay::update_state() { } else if (winner == Team::CT) { sound_manager.play("ct_win"); } + hud_display->update_winner(winner); end_round_display->update_winner_team(winner); break; } @@ -292,10 +294,6 @@ void SDLDisplay::update_state() { case MessageType::BOMB_EXPLODED_RESP: { std::cout << "Received BombExplodedResponse" << std::endl; auto bomb_exploded_resp = msg.get_content(); - /*GameUpdate updates = game.get_full_update(); - EXPECT_TRUE(bomb_exploded_resp.get_explosion_center() == - updates.get_bomb().value().hitbox.get_center()); - EXPECT_EQ(bomb_exploded_resp.get_explosion_radius(), BombConfig::max_range);*/ sound_manager.play("bomb_exploded"); break; } diff --git a/client/sdl_display.h b/client/sdl_display.h index 23a21997..1bd5b2e3 100644 --- a/client/sdl_display.h +++ b/client/sdl_display.h @@ -47,6 +47,7 @@ class SDLDisplay: public Display { std::unique_ptr shop_display; std::unique_ptr world; std::unique_ptr end_round_display; + std::unique_ptr hud_display; SoundManager sound_manager; PhaseType current_phase;