A metric ton of minifixes!
This commit is contained in:
@@ -52,6 +52,8 @@ void dd::Systems::BallSystem::Initialize()
|
||||
physics->Category = CollisionLayer::Type::Ball;
|
||||
physics->Mask = static_cast<CollisionLayer::Type>(CollisionLayer::Type::Pad | CollisionLayer::Type::Brick | CollisionLayer::Type::Wall | CollisionLayer::LifeBuoy);
|
||||
physics->Calculate = true;
|
||||
auto collisionSound = m_World->AddComponent<Components::CollisionSound>(ent);
|
||||
collisionSound->FilePath = "Sounds/Jelly/squid-bounce-n.wav";
|
||||
|
||||
m_World->CommitEntity(ent);
|
||||
|
||||
@@ -325,17 +327,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";
|
||||
|
||||
@@ -187,6 +187,20 @@ bool dd::Systems::KrakenSystem::OnContact(const dd::Events::Contact &event)
|
||||
return false;
|
||||
}
|
||||
|
||||
auto projectile = m_World->GetComponent<Components::Projectile>(otherEntitiy);
|
||||
if (projectile != nullptr) {
|
||||
Events::ScoreEvent es;
|
||||
es.Score = 23;
|
||||
Events::KrakenHit e;
|
||||
e.Kraken = krakenEntity;
|
||||
e.Hitter = otherEntitiy;
|
||||
e.MaxHealth = kraken->MaxHealth;
|
||||
e.CurrentHealth = kraken->Health;
|
||||
e.NewHealth = kraken->Health - 1;
|
||||
EventBroker->Publish(e);
|
||||
m_World->RemoveEntity(otherEntitiy);
|
||||
return true;
|
||||
}
|
||||
auto ball = m_World->GetComponent<Components::Ball>(otherEntitiy);
|
||||
if (ball != nullptr) {
|
||||
ball->Combo += 1;
|
||||
@@ -194,6 +208,8 @@ bool dd::Systems::KrakenSystem::OnContact(const dd::Events::Contact &event)
|
||||
ec.Combo = ball->Combo;
|
||||
ec.Ball = otherEntitiy;
|
||||
EventBroker->Publish(ec);
|
||||
Events::ScoreEvent es;
|
||||
es.Score = ball->Combo * 23;
|
||||
Events::KrakenHit e;
|
||||
e.Kraken = krakenEntity;
|
||||
e.Hitter = otherEntitiy;
|
||||
@@ -202,6 +218,7 @@ bool dd::Systems::KrakenSystem::OnContact(const dd::Events::Contact &event)
|
||||
e.NewHealth = kraken->Health - 1;
|
||||
EventBroker->Publish(e);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool dd::Systems::KrakenSystem::OnKrakenAppear(const dd::Events::KrakenAppear &event)
|
||||
|
||||
@@ -278,6 +278,15 @@ void dd::Systems::LevelSystem::UpdateEntity(double dt, EntityID entity, EntityID
|
||||
}
|
||||
}
|
||||
|
||||
auto brickPart = m_World->GetComponent<Components::BrickPart>(entity);
|
||||
if (brickPart != nullptr) {
|
||||
auto transform = m_World->GetComponent<Components::Transform>(entity);
|
||||
if (transform->Position.y < -10) {
|
||||
m_World->RemoveEntity(entity);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
auto brick = m_World->GetComponent<Components::Brick>(entity);
|
||||
if (brick != nullptr) {
|
||||
auto transform = m_World->GetComponent<Components::Transform>(entity);
|
||||
@@ -310,6 +319,7 @@ void dd::Systems::LevelSystem::UpdateEntity(double dt, EntityID entity, EntityID
|
||||
}
|
||||
m_LooseBricks--;
|
||||
m_World->RemoveEntity(entity);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -908,6 +918,7 @@ bool dd::Systems::LevelSystem::OnPowerUpTaken(const dd::Events::PowerUpTaken &ev
|
||||
|
||||
bool dd::Systems::LevelSystem::OnKrakenDefeated(const dd::Events::KrakenDefeated &event)
|
||||
{
|
||||
m_BrickGenerating = false;
|
||||
SetNumberOfBricks(NumberOfBricks() - 1);
|
||||
m_LooseBricks--;
|
||||
|
||||
@@ -1239,6 +1250,7 @@ void dd::Systems::LevelSystem::CreateBrokenModelPart(EntityID Parent, std::strin
|
||||
auto ent = m_World->CreateEntity(Parent);
|
||||
auto cTemplate = m_World->AddComponent<Components::Template>(ent);
|
||||
auto cTransform = m_World->AddComponent<Components::Transform>(ent);
|
||||
auto cBrickPart = m_World->AddComponent<Components::BrickPart>(ent);
|
||||
|
||||
cTransform->Position = RelativePosition;
|
||||
|
||||
|
||||
@@ -143,7 +143,7 @@ bool dd::Systems::LifebuoySystem::OnLifebuoyHit(const dd::Events::LifebuoyHit &e
|
||||
e.EmittingAngle = glm::half_pi<float>();
|
||||
e.Spread = 0.5f;
|
||||
e.NumberOfTicks = 1;
|
||||
e.ParticleLifeTime = 1.f;
|
||||
e.ParticleLifeTime = 2.f;
|
||||
e.ParticlesPerTick = 1;
|
||||
e.Position = transformComponent->Position;
|
||||
e.ScaleValues.clear();
|
||||
|
||||
@@ -152,7 +152,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;
|
||||
}
|
||||
|
||||
@@ -298,7 +297,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);
|
||||
@@ -476,6 +475,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) {
|
||||
@@ -492,6 +502,10 @@ bool dd::Systems::PadSystem::OnKrakenAttackEnd(const dd::Events::KrakenAttackEnd
|
||||
m_KrakenCharge = 0;
|
||||
m_KrakenStrength = 0;
|
||||
m_PlayerStrength = 0;
|
||||
|
||||
m_World->RemoveEntity(m_KrakenArm);
|
||||
m_KrakenArm = NULL;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -820,6 +820,7 @@ bool dd::Systems::PhysicsSystem::OnContact(const dd::Events::Contact &event)
|
||||
|
||||
model = m_World->GetComponent<Components::Model>(event.Entity1);
|
||||
}
|
||||
Events::PlaySound se;
|
||||
|
||||
//Spawn a particle when a brick collides with somthing
|
||||
Events::CreateParticleSequence e;
|
||||
@@ -843,14 +844,19 @@ bool dd::Systems::PhysicsSystem::OnContact(const dd::Events::Contact &event)
|
||||
auto PowerKraken = m_World->GetComponent<Components::KrakenAttackBrick>(entity);
|
||||
|
||||
if (PowerFriend) {
|
||||
se.FilePath = "Sounds/jap-awesome.wav";
|
||||
e.SpriteFile = "Textures/PowerUps/Friends.png";
|
||||
} else if (PowerSaviour) {
|
||||
se.FilePath = "Sounds/jap-awesome.wav";
|
||||
e.SpriteFile = "Textures/PowerUps/Saviour.png";
|
||||
} else if (PowerSticky) {
|
||||
se.FilePath = "Sounds/jap-awesome.wav";
|
||||
e.SpriteFile = "Textures/PowerUps/Sticky.png";
|
||||
} else if (PowerInkBlaster){
|
||||
se.FilePath = "Sounds/jap-awesome.wav";
|
||||
e.SpriteFile = "Textures/PowerUps/InkBlaster.png";
|
||||
} else if (PowerKraken) {
|
||||
se.FilePath = "Sounds/jap-awesome.wav";
|
||||
e.SpriteFile = "Textures/PowerUps/RealeaseTheKraken.png";
|
||||
}
|
||||
else {
|
||||
@@ -873,6 +879,7 @@ bool dd::Systems::PhysicsSystem::OnContact(const dd::Events::Contact &event)
|
||||
}
|
||||
|
||||
EventBroker->Publish(e);
|
||||
EventBroker->Publish(se);
|
||||
return true;
|
||||
|
||||
|
||||
|
||||
@@ -188,6 +188,11 @@ bool dd::Systems::SoundSystem::OnContact(const dd::Events::Contact &event)
|
||||
|
||||
bool dd::Systems::SoundSystem::OnGameStart(const dd::Events::GameStart &event)
|
||||
{
|
||||
{
|
||||
dd::Events::StopSound e;
|
||||
e.FilePath = STORY_VOICE;
|
||||
EventBroker->Publish(e);
|
||||
}
|
||||
{
|
||||
dd::Events::StopSound e;
|
||||
e.FilePath = MENU_BGM;
|
||||
|
||||
Reference in New Issue
Block a user