diff --git a/include/Core/Engine.h b/include/Core/Engine.h index cc771b9..09db604 100755 --- a/include/Core/Engine.h +++ b/include/Core/Engine.h @@ -187,6 +187,7 @@ public: auto transform = m_World->AddComponent(t_halfPipe); transform->Position = glm::vec3(0.f, 34.6f, -15.f); transform->Scale = glm::vec3(6.f, 6.f, 10.f); + transform->Sticky = false; auto model = m_World->AddComponent(t_halfPipe); model->ModelFile = "Models/Test/halfpipe/Halfpipe.obj"; model->Color = glm::vec4(0.8f, 0.8f, 0.8f, 0.3f); diff --git a/src/game/Game/BallSystem.cpp b/src/game/Game/BallSystem.cpp index 9802c08..ae57913 100644 --- a/src/game/Game/BallSystem.cpp +++ b/src/game/Game/BallSystem.cpp @@ -104,6 +104,12 @@ void dd::Systems::BallSystem::UpdateEntity(double dt, EntityID entity, EntityID if (templateCheck != nullptr){ return; } if (ballComponent != nullptr) { + if (ReplaceBall()) { + SetReplaceBall(false); + m_Waiting = true; + ballComponent->Waiting = true; + } + if (ballComponent->Waiting) { if (m_Waiting == false) { ballComponent->Waiting = false; @@ -126,12 +132,7 @@ void dd::Systems::BallSystem::UpdateEntity(double dt, EntityID entity, EntityID return; } } - if (ReplaceBall()) { - SetReplaceBall(false); - m_Waiting = true; - ballComponent->Waiting = true; - } - + auto transformBall = m_World->GetComponent(entity); if (glm::abs(transformBall->Velocity.y) < 2) { if (transformBall->Velocity.y > 0) { diff --git a/src/game/Game/LevelSystem.cpp b/src/game/Game/LevelSystem.cpp index b187a98..a96038a 100755 --- a/src/game/Game/LevelSystem.cpp +++ b/src/game/Game/LevelSystem.cpp @@ -65,7 +65,7 @@ void dd::Systems::LevelSystem::UpdateEntity(double dt, EntityID entity, EntityID // Check the background. auto model = m_World->GetComponent(entity); if (model != nullptr) { - if (model->ModelFile == "Models/Test/halfpipe/Halfpipe.obj") { + if (model->ModelFile == "Models/Test/halfpipe/Halfpipe.obj") { auto transform = m_World->GetComponent(entity); if (transform->Position.y <= -34.6) { transform->Position.y = 34.6; diff --git a/src/game/Game/PadSystem.cpp b/src/game/Game/PadSystem.cpp index 6e4d454..55d8790 100755 --- a/src/game/Game/PadSystem.cpp +++ b/src/game/Game/PadSystem.cpp @@ -165,7 +165,10 @@ bool dd::Systems::PadSystem::OnKeyDown(const dd::Events::KeyDown &event) { e.Time = 0.2; e.Type = "All"; EventBroker->Publish(e); - } else if (val == GLFW_KEY_SPACE) { + } else if (val == GLFW_KEY_S) { + Events::StageCleared e; + EventBroker->Publish(e); + } else if (val == GLFW_KEY_SPACE) { Events::ActionButton e; EventBroker->Publish(e); } else if (val == GLFW_KEY_D) { diff --git a/src/game/Physics/PhysicsSystem.cpp b/src/game/Physics/PhysicsSystem.cpp index 86b7d9f..001a048 100755 --- a/src/game/Physics/PhysicsSystem.cpp +++ b/src/game/Physics/PhysicsSystem.cpp @@ -257,6 +257,8 @@ void dd::Systems::PhysicsSystem::UpdateEntity(double dt, EntityID entity, Entity if (!transform->Sticky) { transform->Position.y -= 6.0f * dt; } + } else { + transform->Position.y -= 6.0f * dt; } } auto particle = m_World->GetComponent(entity);