MultiBalls appear depending on pad's position
This commit is contained in:
@@ -16,7 +16,7 @@ namespace Events
|
|||||||
|
|
||||||
struct MultiBall : Event
|
struct MultiBall : Event
|
||||||
{
|
{
|
||||||
|
Components::Transform* padTransform;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -96,6 +96,7 @@ void dd::Systems::PadSystem::Update(double dt)
|
|||||||
SetMultiBall(false);
|
SetMultiBall(false);
|
||||||
|
|
||||||
Events::MultiBall e;
|
Events::MultiBall e;
|
||||||
|
e.padTransform = transform;
|
||||||
EventBroker->Publish(e);
|
EventBroker->Publish(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -220,8 +221,9 @@ bool dd::Systems::PadSystem::OnMultiBall(const dd::Events::MultiBall &event)
|
|||||||
auto ent2 = CreateBall();
|
auto ent2 = CreateBall();
|
||||||
auto transform1 = m_World->GetComponent<Components::Transform>(ent1);
|
auto transform1 = m_World->GetComponent<Components::Transform>(ent1);
|
||||||
auto transform2 = m_World->GetComponent<Components::Transform>(ent2);
|
auto transform2 = m_World->GetComponent<Components::Transform>(ent2);
|
||||||
transform1->Position = glm::vec3(3, -6, -10);
|
auto padTransform = event.padTransform;
|
||||||
transform2->Position = glm::vec3(6, -6, -10);
|
transform1->Position = glm::vec3(padTransform->Position.x - 4, -6, -10);
|
||||||
|
transform2->Position = glm::vec3(padTransform->Position.x + 4, -6, -10);
|
||||||
|
|
||||||
Events::SetImpulse e1;
|
Events::SetImpulse e1;
|
||||||
e1.Entity = ent1;
|
e1.Entity = ent1;
|
||||||
|
|||||||
Reference in New Issue
Block a user