Fixes smaller problems
This commit is contained in:
@@ -187,6 +187,7 @@ public:
|
||||
auto transform = m_World->AddComponent<Components::Transform>(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<Components::Model>(t_halfPipe);
|
||||
model->ModelFile = "Models/Test/halfpipe/Halfpipe.obj";
|
||||
model->Color = glm::vec4(0.8f, 0.8f, 0.8f, 0.3f);
|
||||
|
||||
@@ -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<Components::Transform>(entity);
|
||||
if (glm::abs(transformBall->Velocity.y) < 2) {
|
||||
if (transformBall->Velocity.y > 0) {
|
||||
|
||||
@@ -65,7 +65,7 @@ void dd::Systems::LevelSystem::UpdateEntity(double dt, EntityID entity, EntityID
|
||||
// Check the background.
|
||||
auto model = m_World->GetComponent<Components::Model>(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<Components::Transform>(entity);
|
||||
if (transform->Position.y <= -34.6) {
|
||||
transform->Position.y = 34.6;
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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<Components::Particle>(entity);
|
||||
|
||||
Reference in New Issue
Block a user