Combos now show up as a particle when it is reset
This commit is contained in:
@@ -26,6 +26,7 @@ void dd::Systems::BallSystem::Initialize()
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EStageCleared, &BallSystem::OnStageCleared);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EArrivedAtNewStage, &BallSystem::OnArrivedToNewStage);
|
||||
|
||||
|
||||
//OctoBall
|
||||
{
|
||||
auto ent = m_World->CreateEntity();
|
||||
@@ -287,6 +288,40 @@ bool dd::Systems::BallSystem::Contact(const Events::Contact &event)
|
||||
float x = (ballTransform->Position.x - padTransform->Position.x) * XMovementMultiplier();
|
||||
float y = glm::cos((abs(x) / (1.6f)) * glm::pi<float>() / 2.f) + 1.f;
|
||||
|
||||
//When a combo is more than 2 create a particle showing it.
|
||||
if (ballComponent->Combo >= 1){
|
||||
|
||||
Events::CreateParticleSequence particleEvent;
|
||||
|
||||
particleEvent.EmitterLifeTime = 3;
|
||||
particleEvent.EmittingAngle = glm::half_pi<float>();
|
||||
particleEvent.Spread = 0.f;
|
||||
particleEvent.NumberOfTicks = 1;
|
||||
particleEvent.ParticleLifeTime = 2.f;
|
||||
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.Radius = 1.f;
|
||||
particleEvent.Color = glm::vec4(1.f);
|
||||
particleEvent.Speed = 0;
|
||||
|
||||
if (ballComponent->Combo <= 9) {
|
||||
particleEvent.SpriteFile = "Textures/Combo/Combo00" + std::to_string(ballComponent->Combo) + ".png";
|
||||
} else if (ballComponent->Combo <= 99) {
|
||||
particleEvent.SpriteFile = "Textures/Combo/Combo0" + std::to_string(ballComponent->Combo) + ".png";
|
||||
} else {
|
||||
particleEvent.SpriteFile = "Textures/Combo/Combo" + std::to_string(ballComponent->Combo) + ".png";
|
||||
}
|
||||
EventBroker->Publish(particleEvent);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
ballComponent->Combo = 0;
|
||||
if (!ballComponent->Waiting) {
|
||||
if (m_InkBlaster) {
|
||||
|
||||
Reference in New Issue
Block a user