Updated blood effects
This commit is contained in:
Binary file not shown.
@@ -145,7 +145,7 @@ private:
|
|||||||
bool m_Pause = false;
|
bool m_Pause = false;
|
||||||
int m_LooseBricks = 0;
|
int m_LooseBricks = 0;
|
||||||
int m_CurrentCluster = 1;
|
int m_CurrentCluster = 1;
|
||||||
int m_CurrentLevel = 6;
|
int m_CurrentLevel = 1;
|
||||||
int m_MultiBalls = 0;
|
int m_MultiBalls = 0;
|
||||||
int m_PowerUps = 0;
|
int m_PowerUps = 0;
|
||||||
int m_Score = 0;
|
int m_Score = 0;
|
||||||
|
|||||||
@@ -26,6 +26,8 @@ struct ParticleEmitter : public Component
|
|||||||
//values to interpolate between.
|
//values to interpolate between.
|
||||||
std::vector<glm::vec3> ScaleValues;
|
std::vector<glm::vec3> ScaleValues;
|
||||||
std::vector<float> AlphaValues;
|
std::vector<float> AlphaValues;
|
||||||
|
std::vector<glm::vec3> VelocityValues;
|
||||||
|
|
||||||
|
|
||||||
//System variables
|
//System variables
|
||||||
float GravityScale = 1.0f;
|
float GravityScale = 1.0f;
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ struct CreateParticleSequence : public Event
|
|||||||
bool DefaultScale = false;
|
bool DefaultScale = false;
|
||||||
std::vector<glm::vec3> ScaleValues;
|
std::vector<glm::vec3> ScaleValues;
|
||||||
std::vector<float> AlphaValues;
|
std::vector<float> AlphaValues;
|
||||||
|
std::vector<glm::vec3> VelocityValues;
|
||||||
|
|
||||||
//Particle
|
//Particle
|
||||||
std::string SpriteFile = "";
|
std::string SpriteFile = "";
|
||||||
|
|||||||
@@ -118,51 +118,51 @@ void dd::Systems::KrakenSystem::UpdateEntity(double dt, EntityID entity, EntityI
|
|||||||
krakenAttack.PlayerStrength = 0.05;
|
krakenAttack.PlayerStrength = 0.05;
|
||||||
EventBroker->Publish(krakenAttack);
|
EventBroker->Publish(krakenAttack);
|
||||||
break;
|
break;
|
||||||
// case 3: // Brick Generating
|
case 3: // Brick Generating
|
||||||
// {
|
{
|
||||||
// m_NumberOfActions++;
|
m_NumberOfActions++;
|
||||||
// kraken->CurrentAction = 1;
|
kraken->CurrentAction = 1;
|
||||||
// Events::BrickGenerating e;
|
Events::BrickGenerating e;
|
||||||
// e.Origin1 = glm::vec3(-5, 7, -10);
|
e.Origin1 = glm::vec3(-5, 7, -10);
|
||||||
// e.Origin2 = glm::vec3(5, 7, -10);
|
e.Origin2 = glm::vec3(5, 7, -10);
|
||||||
// if (kraken->Health > 20) {
|
if (kraken->Health > 20) {
|
||||||
// e.SetCluster = 0;
|
e.SetCluster = 0;
|
||||||
// } else if (kraken->Health > 10) {
|
} else if (kraken->Health > 10) {
|
||||||
// e.SetCluster = 1;
|
e.SetCluster = 1;
|
||||||
// } else {
|
} else {
|
||||||
// e.SetCluster = 2;
|
e.SetCluster = 2;
|
||||||
// }
|
}
|
||||||
// std::uniform_real_distribution<float> dist(1, 6.999f);
|
std::uniform_real_distribution<float> dist(1, 6.999f);
|
||||||
// float random = dist(m_RandomGenerator);
|
float random = dist(m_RandomGenerator);
|
||||||
// e.Set = random;
|
e.Set = random;
|
||||||
// EventBroker->Publish(e);
|
EventBroker->Publish(e);
|
||||||
// break;
|
break;
|
||||||
// }
|
}
|
||||||
// case 4: // Brick Generating second case
|
case 4: // Brick Generating second case
|
||||||
// {
|
{
|
||||||
// kraken->CurrentAction = 1;
|
kraken->CurrentAction = 1;
|
||||||
// Events::BrickGenerating e;
|
Events::BrickGenerating e;
|
||||||
// e.Origin1 = glm::vec3(-5, 7, -10);
|
e.Origin1 = glm::vec3(-5, 7, -10);
|
||||||
// e.Origin2 = glm::vec3(5, 7, -10);
|
e.Origin2 = glm::vec3(5, 7, -10);
|
||||||
// if (kraken->Health > 20) {
|
if (kraken->Health > 20) {
|
||||||
// e.SetCluster = 0;
|
e.SetCluster = 0;
|
||||||
// } else if (kraken->Health > 10) {
|
} else if (kraken->Health > 10) {
|
||||||
// e.SetCluster = 1;
|
e.SetCluster = 1;
|
||||||
// } else {
|
} else {
|
||||||
// e.SetCluster = 2;
|
e.SetCluster = 2;
|
||||||
// }
|
}
|
||||||
// std::uniform_real_distribution<float> dist(1, 6.999f);
|
std::uniform_real_distribution<float> dist(1, 6.999f);
|
||||||
// float random = dist(m_RandomGenerator);
|
float random = dist(m_RandomGenerator);
|
||||||
// e.Set = random;
|
e.Set = random;
|
||||||
// EventBroker->Publish(e);
|
EventBroker->Publish(e);
|
||||||
// break;
|
break;
|
||||||
// }
|
}
|
||||||
// case 5: // Taunting
|
case 5: // Taunting
|
||||||
// if (m_ReturnToIdle) {
|
if (m_ReturnToIdle) {
|
||||||
// m_ReturnToIdle = false;
|
m_ReturnToIdle = false;
|
||||||
// kraken->CurrentAction = Idle;
|
kraken->CurrentAction = Idle;
|
||||||
// }
|
}
|
||||||
// break;
|
break;
|
||||||
default:
|
default:
|
||||||
//LOG_INFO("Something's probably off about the random number generator.");
|
//LOG_INFO("Something's probably off about the random number generator.");
|
||||||
break;
|
break;
|
||||||
@@ -289,28 +289,6 @@ bool dd::Systems::KrakenSystem::OnKrakenHit(const dd::Events::KrakenHit &event)
|
|||||||
m_KrakenCurrentSecondsToAction = m_KrakenMaxSecondsToAction - (modifier * timeDifferenceBetweenMaxAndMin);
|
m_KrakenCurrentSecondsToAction = m_KrakenMaxSecondsToAction - (modifier * timeDifferenceBetweenMaxAndMin);
|
||||||
// If modifier is 1, MaxSeconds is 15, MinSeconds is 5, then... 15 - (1 * 10), meaning 5.
|
// If modifier is 1, MaxSeconds is 15, MinSeconds is 5, then... 15 - (1 * 10), meaning 5.
|
||||||
|
|
||||||
auto ball = m_World->GetComponent<Components::Transform>(event.Hitter);
|
|
||||||
if (ball != nullptr) {
|
|
||||||
// //Particle trail
|
|
||||||
// Events::CreateParticleSequence trail;
|
|
||||||
// trail.parent = event.Hitter;
|
|
||||||
// trail.AlphaValues.push_back(1.f);
|
|
||||||
// trail.AlphaValues.push_back(0.f);
|
|
||||||
// trail.ScaleValues.push_back(glm::vec3(0.08f));
|
|
||||||
// trail.ScaleValues.push_back(glm::vec3(0.f));
|
|
||||||
// trail.RadiusDistribution = 2;
|
|
||||||
// trail.EmitterLifeTime = 1.f;
|
|
||||||
// trail.ParticleLifeTime = 1.f;
|
|
||||||
// trail.ParticlesPerTick = 1;
|
|
||||||
// trail.SpawnRate = 0.5f;
|
|
||||||
// trail.Speed = 10.f;
|
|
||||||
// trail.EmittingAngle = glm::half_pi<float>();
|
|
||||||
// trail.SpriteFile = "Textures/Particles/FadeBall.png";
|
|
||||||
// trail.Color = glm::vec4(1, 0, 0, 1);
|
|
||||||
// //p.Spread = ...
|
|
||||||
// EventBroker->Publish(trail);
|
|
||||||
}
|
|
||||||
|
|
||||||
CreateBloodEffect(transform->Position);
|
CreateBloodEffect(transform->Position);
|
||||||
|
|
||||||
//std::cout << kraken->Health << std::endl;
|
//std::cout << kraken->Health << std::endl;
|
||||||
@@ -429,7 +407,7 @@ void dd::Systems::KrakenSystem::CreateBloodEffect(glm::vec3 pos)
|
|||||||
dust.EmittingAngle = glm::half_pi<float>();
|
dust.EmittingAngle = glm::half_pi<float>();
|
||||||
dust.Spread = 0.5f;
|
dust.Spread = 0.5f;
|
||||||
dust.NumberOfTicks = 1;
|
dust.NumberOfTicks = 1;
|
||||||
dust.ParticleLifeTime = 2.f;
|
dust.ParticleLifeTime = 1.f;
|
||||||
dust.ParticlesPerTick = 1;
|
dust.ParticlesPerTick = 1;
|
||||||
dust.Position = pos;
|
dust.Position = pos;
|
||||||
dust.ScaleValues.clear();
|
dust.ScaleValues.clear();
|
||||||
@@ -447,7 +425,7 @@ void dd::Systems::KrakenSystem::CreateBloodEffect(glm::vec3 pos)
|
|||||||
float angle = dist(m_RandomGenerator);
|
float angle = dist(m_RandomGenerator);
|
||||||
|
|
||||||
Events::CreateParticleSequence squirt;
|
Events::CreateParticleSequence squirt;
|
||||||
squirt.EmitterLifeTime = 0.5f;
|
squirt.EmitterLifeTime = 0.3f;
|
||||||
squirt.EmittingAngle = angle;
|
squirt.EmittingAngle = angle;
|
||||||
squirt.Spread = 0;
|
squirt.Spread = 0;
|
||||||
squirt.SpawnRate = 0.01f;
|
squirt.SpawnRate = 0.01f;
|
||||||
@@ -465,19 +443,24 @@ void dd::Systems::KrakenSystem::CreateBloodEffect(glm::vec3 pos)
|
|||||||
EventBroker->Publish(squirt);
|
EventBroker->Publish(squirt);
|
||||||
}
|
}
|
||||||
Events::CreateParticleSequence drop;
|
Events::CreateParticleSequence drop;
|
||||||
drop.EmitterLifeTime = 0.5f;
|
drop.EmitterLifeTime = 7.f;
|
||||||
drop.EmittingAngle = glm::two_pi<float>() + glm::pi<float>();
|
drop.SpawnRate = 0.1f;
|
||||||
drop.Spread = glm::two_pi<float>();
|
//drop.EmittingAngle = glm::two_pi<float>() + glm::pi<float>();
|
||||||
drop.ParticleLifeTime = 0.5f;
|
drop.EmittingAngle = -glm::half_pi<float>();
|
||||||
drop.ParticlesPerTick = 5;
|
drop.Spread = 0;
|
||||||
|
//drop.Spread = glm::two_pi<float>();
|
||||||
|
drop.ParticleLifeTime = 1.f;
|
||||||
|
drop.ParticlesPerTick = 2;
|
||||||
drop.Position = pos;
|
drop.Position = pos;
|
||||||
drop.ScaleValues.clear();
|
drop.ScaleValues.clear();
|
||||||
drop.ScaleValues.push_back(glm::vec3(0.2f));
|
drop.ScaleValues.push_back(glm::vec3(.15f));
|
||||||
|
drop.ScaleValues.push_back(glm::vec3(0.1f));
|
||||||
drop.SpriteFile = "Textures/Particles/FadeBall.png";
|
drop.SpriteFile = "Textures/Particles/FadeBall.png";
|
||||||
drop.Color = glm::vec4(1, 0, 0, 1);
|
drop.Color = glm::vec4(1, 0, 0, 1);
|
||||||
drop.AlphaValues.clear();
|
drop.AlphaValues.clear();
|
||||||
drop.AlphaValues.push_back(1.f);
|
drop.AlphaValues.push_back(1.f);
|
||||||
drop.AlphaValues.push_back(0.f);
|
drop.AlphaValues.push_back(0.f);
|
||||||
drop.Speed = 100;
|
drop.GravityScale = 0;
|
||||||
|
drop.Speed = 300;
|
||||||
EventBroker->Publish(drop);
|
EventBroker->Publish(drop);
|
||||||
}
|
}
|
||||||
@@ -592,7 +592,7 @@ void dd::Systems::PhysicsSystem::UpdateParticleEmitters(double dt)
|
|||||||
|
|
||||||
|
|
||||||
//Random z-value
|
//Random z-value
|
||||||
std::uniform_real_distribution<float> dist(0, 1);
|
std::uniform_real_distribution<float> dist(0, 0.1);
|
||||||
float zDistribution = dist(gen);
|
float zDistribution = dist(gen);
|
||||||
particleTransform->Position = glm::vec3(emitterTransform->Position.x, emitterTransform->Position.y, -9.5f + zDistribution);
|
particleTransform->Position = glm::vec3(emitterTransform->Position.x, emitterTransform->Position.y, -9.5f + zDistribution);
|
||||||
particleTransform->Scale = particleTemplate->Scale;
|
particleTransform->Scale = particleTemplate->Scale;
|
||||||
@@ -730,6 +730,7 @@ bool dd::Systems::PhysicsSystem::CreateParticleSequence(const Events::CreatePart
|
|||||||
particleEmitter->RadiusDistribution = event.RadiusDistribution;
|
particleEmitter->RadiusDistribution = event.RadiusDistribution;
|
||||||
particleEmitter->DefaultScale = event.DefaultScale;
|
particleEmitter->DefaultScale = event.DefaultScale;
|
||||||
particleEmitter->ScaleValues = event.ScaleValues;
|
particleEmitter->ScaleValues = event.ScaleValues;
|
||||||
|
particleEmitter->VelocityValues = event.VelocityValues;
|
||||||
{
|
{
|
||||||
//Creating Particle Template
|
//Creating Particle Template
|
||||||
auto particle = m_World->CreateEntity(emitter);
|
auto particle = m_World->CreateEntity(emitter);
|
||||||
|
|||||||
Reference in New Issue
Block a user