Merge remote-tracking branch 'origin/master' into Sound+Particles
Conflicts: src/GameWorld.cpp
This commit is contained in:
@@ -128,11 +128,11 @@ void Systems::TankSteeringSystem::UpdateEntity(double dt, EntityID entity, Entit
|
||||
}
|
||||
|
||||
{
|
||||
// Events::PlaySFX e;
|
||||
// e.Resource = "Sounds/SFX/TankShot.mp3";
|
||||
// e.Position = absoluteTransform.Position;
|
||||
// e.Loop = false;
|
||||
// EventBroker->Publish(e);
|
||||
Events::PlaySFX e;
|
||||
e.Resource = "Sounds/SFX/TankShot.mp3";
|
||||
e.Position = cloneTransform->Position;
|
||||
e.Loop = false;
|
||||
EventBroker->Publish(e);
|
||||
}
|
||||
|
||||
auto clonePhysicsComponent = m_World->GetComponent<Components::Physics>(clone);
|
||||
@@ -256,11 +256,11 @@ bool Systems::TankSteeringSystem::OnCollision(const Events::Collision &e)
|
||||
EventBroker->Publish(e);
|
||||
}
|
||||
{
|
||||
// Events::PlaySFX e;
|
||||
// e.MinDistance = 150.f;
|
||||
// e.Position = shellTransform->Position;
|
||||
// e.Resource = "Sounds/SFX/Explosion.wav";
|
||||
// EventBroker->Publish(e);
|
||||
Events::PlaySFX e;
|
||||
e.MinDistance = 150.f;
|
||||
e.Position = shellTransform->Position;
|
||||
e.Resource = "Sounds/SFX/Explosion.wav";
|
||||
EventBroker->Publish(e);
|
||||
}
|
||||
|
||||
for (auto &physComponent : *physicsComponents)
|
||||
@@ -383,11 +383,11 @@ bool Systems::TankSteeringSystem::OnSpawnVehicle(const Events::SpawnVehicle &eve
|
||||
return false;
|
||||
}
|
||||
|
||||
for (auto &spawnPointComponent : *spawnPointComponents)
|
||||
for (auto &component : *spawnPointComponents)
|
||||
{
|
||||
auto spawnPoint = spawnPointComponent->Entity;
|
||||
auto spawnPointBaseParent = m_World->GetEntityBaseParent(spawnPoint);
|
||||
auto playerComponent = m_World->GetComponent<Components::Player>(spawnPointBaseParent);
|
||||
auto spawnPoint = component->Entity;
|
||||
auto spawnPointComponent = std::dynamic_pointer_cast<Components::SpawnPoint>(component);
|
||||
auto playerComponent = m_World->GetComponent<Components::Player>(spawnPointComponent->Player);
|
||||
if (!playerComponent || playerComponent->ID != event.PlayerID)
|
||||
continue;
|
||||
|
||||
@@ -430,6 +430,7 @@ EntityID Systems::TankSteeringSystem::CreateTank(int playerID)
|
||||
m_World->AddComponent<Components::Input>(tank);
|
||||
auto health = m_World->AddComponent<Components::Health>(tank);
|
||||
health->Amount = 100.f;
|
||||
m_World->AddComponent<Components::Listener>(tank);
|
||||
|
||||
{
|
||||
auto shape = m_World->CreateEntity(tank);
|
||||
|
||||
Reference in New Issue
Block a user