Merge remote-tracking branch 'origin/master' into water

This commit is contained in:
Stiffly
2015-10-16 11:54:35 +02:00
80 changed files with 1670 additions and 215 deletions
+39 -2
View File
@@ -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();
@@ -34,7 +35,9 @@ void dd::Systems::BallSystem::Initialize()
transform->Scale = glm::vec3(0.3f, 0.3f, 0.3f);
transform->Velocity = glm::vec3(0.f, 0.f, 0.f);
auto model = m_World->AddComponent<Components::Model>(ent);
model->ModelFile = "Models/Test/Ball/Sid.obj";
model->ModelFile = "Models/Sid/Sid.dae";
auto animation = m_World->AddComponent<Components::Animation>(ent);
animation->Speed = 1.0;
std::shared_ptr<Components::CircleShape> circleShape = m_World->AddComponent<Components::CircleShape>(ent);
circleShape->Radius = 0.4f;
std::shared_ptr<Components::Ball> ball = m_World->AddComponent<Components::Ball>(ent);
@@ -287,6 +290,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 >= 2){
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.ScaleValues.push_back(glm::vec3(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 <= 42) {
particleEvent.SpriteFile = "Textures/Combo/Combo0" + std::to_string(ballComponent->Combo) + ".png";
} else {
particleEvent.SpriteFile = "Textures/Combo/Combo043.png";
}
EventBroker->Publish(particleEvent);
}
ballComponent->Combo = 0;
if (!ballComponent->Waiting) {
if (m_InkBlaster) {
@@ -386,7 +423,7 @@ void dd::Systems::BallSystem::CreateLife(int number)
lifeNr->Number = number;
auto model = m_World->AddComponent<Components::Model>(life);
model->ModelFile = "Models/Test/Ball/Sid.obj";
model->ModelFile = "Models/Sid/Sid.dae";
m_World->CommitEntity(life);