From 6e33a7334fa7132255aac98b80402325078cbfaa Mon Sep 17 00:00:00 2001 From: Rita1218 <145887023+Rita1218@users.noreply.github.com> Date: Thu, 18 Jan 2024 20:18:48 +0800 Subject: [PATCH] Update game_ball.cpp --- src/GameBall/core/game_ball.cpp | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/src/GameBall/core/game_ball.cpp b/src/GameBall/core/game_ball.cpp index 3b45911..78ad6a3 100644 --- a/src/GameBall/core/game_ball.cpp +++ b/src/GameBall/core/game_ball.cpp @@ -38,19 +38,34 @@ void GameBall::OnInit() { auto primary_player = world->CreatePlayer(); auto enemy_player = world->CreatePlayer(); auto primary_unit = world->CreateUnit( - primary_player->PlayerId(), glm::vec3{0.0f, 1.0f, 0.0f}, 1.0f, 1.0f); + primary_player->PlayerId(), glm::vec3{2.5f, 1.0f, 0.0f}, 1.0f, 1.0f); auto enemy_unit_1 = world->CreateUnit( - enemy_player->PlayerId(), glm::vec3{-5.0f, 1.0f, 0.0f}, 1.0f, 1.0f); - auto enemy_unit_2 = world->CreateUnit( - enemy_player->PlayerId(), glm::vec3{5.0f, 1.0f, 0.0f}, 1.0f, 1.0f); - auto enemy_unit_3 = world->CreateUnit( + enemy_player->PlayerId(), glm::vec3{-2.5f, 1.0f, 0.0f}, 1.0f, 1.0f); + auto enemy_unit_2 = world->CreateObstacle( + glm::vec3{0.0f, -0.53f, 5.0f}, std::numeric_limits::infinity(), + false, 2.0f); + auto enemy_unit_3 = world->CreateObstacle( + glm::vec3{0.0f, -0.53f, -5.0f}, std::numeric_limits::infinity(), + false, 2.0f); + auto enemy_unit_4 = world->CreateObstacle( + glm::vec3{5.0f, -0.53f, 0.0f}, std::numeric_limits::infinity(), + false, 2.0f); + auto enemy_unit_5 = world->CreateObstacle( + glm::vec3{-5.0f, -0.53f, 0.0f}, std::numeric_limits::infinity(), + false, 2.0f); + auto enemy_unit_6 = world->CreateObstacle( + glm::vec3{0.0f, -0.53f, 0.0f}, std::numeric_limits::infinity(), + false, 2.0f); + + /*auto enemy_unit_3 = world->CreateUnit( enemy_player->PlayerId(), glm::vec3{0.0f, 1.0f, 5.0f}, 1.0f, 1.0f); auto enemy_unit_4 = world->CreateUnit( - enemy_player->PlayerId(), glm::vec3{0.0f, 1.0f, -5.0f}, 1.0f, 1.0f); + enemy_player->PlayerId(), glm::vec3{0.0f, 1.0f, -5.0f}, 1.0f, 1.0f);*/ auto primary_obstacle = world->CreateObstacle( glm::vec3{0.0f, -10.0f, 0.0f}, std::numeric_limits::infinity(), false, 20.0f); + primary_player_id_ = primary_player->PlayerId(); enemy_player_id_ = enemy_player->PlayerId();