Merge branch 'Tobias'
This commit is contained in:
@@ -320,17 +320,20 @@ bool dd::Systems::BallSystem::Contact(const Events::Contact &event)
|
||||
particleEvent.EmittingAngle = glm::half_pi<float>();
|
||||
particleEvent.Spread = 0.f;
|
||||
particleEvent.NumberOfTicks = 1;
|
||||
particleEvent.ParticleLifeTime = 2.f;
|
||||
particleEvent.ParticleLifeTime = 1.3f;
|
||||
particleEvent.ParticlesPerTick = 1;
|
||||
particleEvent.Position = glm::vec3(ballTransform->Position.x, -3.f, -3.f);
|
||||
if (ballTransform->Position.x >= 2.7f) {
|
||||
particleEvent.Position = glm::vec3(2.7f, -3.f, -3.f);
|
||||
} else if (ballTransform->Position.x <= -2.7f) {
|
||||
particleEvent.Position = glm::vec3(-2.7f, -3.f, -3.f);
|
||||
particleEvent.Position = glm::vec3(ballTransform->Position.x, -3.5f, -3.f);
|
||||
if (ballTransform->Position.x >= 2.5f) {
|
||||
particleEvent.Position = glm::vec3(2.5f, -3.5f, -3.f);
|
||||
} else if (ballTransform->Position.x <= -2.5f) {
|
||||
particleEvent.Position = glm::vec3(-2.5f, -3.5f, -3.f);
|
||||
}
|
||||
particleEvent.ScaleValues.push_back(glm::vec3(1.f));
|
||||
particleEvent.ScaleValues.push_back(glm::vec3(1.5f));
|
||||
particleEvent.ScaleValues.push_back(glm::vec3(2.f));
|
||||
particleEvent.Color = glm::vec4(1.f);
|
||||
particleEvent.Speed = 0;
|
||||
particleEvent.Speed = 1.f;
|
||||
particleEvent.AlphaValues.push_back(1.f);
|
||||
particleEvent.AlphaValues.push_back(0.7f);
|
||||
|
||||
if (ballComponent->Combo <= 9) {
|
||||
particleEvent.SpriteFile = "Textures/Combo/Combo00" + std::to_string(ballComponent->Combo) + ".png";
|
||||
|
||||
@@ -151,7 +151,6 @@ void dd::Systems::PadSystem::Update(double dt)
|
||||
Events::KrakenAttack e;
|
||||
e.ChargeUpdate = m_KrakenCharge;
|
||||
EventBroker->Publish(e);
|
||||
//std::cout << "Charge: " << m_KrakenCharge << std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -297,7 +296,7 @@ bool dd::Systems::PadSystem::OnKeyDown(const dd::Events::KeyDown &event) {
|
||||
} else if (val == GLFW_KEY_Q) {
|
||||
Events::Move e;
|
||||
e.Entity = Entity();
|
||||
e.GoalPosition = glm::vec3(0, 0, -10);
|
||||
e.GoalPosition = glm::vec3(0, 0, -10);
|
||||
e.Speed = 5;
|
||||
e.Queue = false;
|
||||
EventBroker->Publish(e);
|
||||
@@ -475,6 +474,17 @@ bool dd::Systems::PadSystem::OnKrakenAttack(const dd::Events::KrakenAttack &even
|
||||
transform->Velocity = glm::vec3(0, 0, 0);
|
||||
acceleration = glm::vec3(0, 0, 0);
|
||||
|
||||
if (!m_KrakenArm){
|
||||
m_KrakenArm = m_World->CreateEntity(Entity());
|
||||
auto transform = m_World->AddComponent<Components::Transform>(m_KrakenArm);
|
||||
transform->Position = glm::vec3(1.f, -3.0f, 0.f);
|
||||
auto model = m_World->AddComponent<Components::Model>(m_KrakenArm);
|
||||
model->ModelFile = "Models/kraken/Arm.dae";
|
||||
auto animation = m_World->AddComponent<Components::Animation>(m_KrakenArm);
|
||||
animation->Speed = 1.0f;
|
||||
m_World->CommitEntity(m_KrakenArm);
|
||||
}
|
||||
|
||||
SetTransform(transform);
|
||||
SetAcceleration(acceleration);
|
||||
} else if (m_KrakenCharge >= 1) {
|
||||
@@ -482,6 +492,10 @@ bool dd::Systems::PadSystem::OnKrakenAttack(const dd::Events::KrakenAttack &even
|
||||
m_KrakenCharge = 0;
|
||||
m_KrakenStrength = 0;
|
||||
m_PlayerStrength = 0;
|
||||
|
||||
m_World->RemoveEntity(m_KrakenArm);
|
||||
m_KrakenArm = NULL;
|
||||
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user