diff --git a/src/Events/CreateExplosion.h b/src/Events/CreateExplosion.h index 3766c6b..f7b5932 100644 --- a/src/Events/CreateExplosion.h +++ b/src/Events/CreateExplosion.h @@ -11,6 +11,7 @@ namespace Events { CreateExplosion() : Color(glm::vec4(0)), + usePointLight(false), UseGoalVector(false) {} glm::vec3 Position; @@ -21,6 +22,7 @@ namespace Events glm::quat RelativeUpOrientation; float Speed; float SpreadAngle; + float usePointLight; std::vector ParticleScale; bool UseGoalVector; glm::vec3 GoalVelocity; diff --git a/src/Systems/ParticleSystem.cpp b/src/Systems/ParticleSystem.cpp index 9546f06..6b31f72 100644 --- a/src/Systems/ParticleSystem.cpp +++ b/src/Systems/ParticleSystem.cpp @@ -268,6 +268,13 @@ bool Systems::ParticleSystem::CreateExplosion(const Events::CreateExplosion &e) auto templateComponent = m_World->AddComponent(particleEnt); auto TEMP = m_World->AddComponent(particleEnt); auto spriteComponent = m_World->AddComponent(particleEnt); + if(e.usePointLight) + { + auto light = m_World->AddComponent(particleEnt); + light->Diffuse = glm::vec3(231.f/255.f, 181.f/255.f, 48.f/255.f); + light->Specular = glm::vec3(0.5f, 0.5f, 0.5f); + light->Radius = 20.f; + } spriteComponent->SpriteFile = e.spritePath; m_World->CommitEntity(particleEnt); emitter->ParticleTemplate = particleEnt; diff --git a/src/Systems/ParticleSystem.h b/src/Systems/ParticleSystem.h index f70cc9d..57b5d65 100644 --- a/src/Systems/ParticleSystem.h +++ b/src/Systems/ParticleSystem.h @@ -5,6 +5,7 @@ #include "Systems/TransformSystem.h" #include "Components/Transform.h" #include "Components/ParticleEmitter.h" +#include "Components/PointLight.h" #include "Components/Particle.h" #include "Components/Sprite.h" #include "EventBroker.h" diff --git a/src/Systems/TankSteeringSystem.cpp b/src/Systems/TankSteeringSystem.cpp index dddf219..40063ea 100644 --- a/src/Systems/TankSteeringSystem.cpp +++ b/src/Systems/TankSteeringSystem.cpp @@ -252,6 +252,7 @@ bool Systems::TankSteeringSystem::OnCollision(const Events::Collision &e) e.Speed = 6; e.SpreadAngle = glm::pi(); e.spritePath = "Textures/Sprites/Blast1.png"; + e.usePointLight = true; e.Color = glm::vec4(2, 2, 2, 0.2); EventBroker->Publish(e);