Tanks now have listeners.
This commit is contained in:
+1
-1
Submodule assets updated: 78ba667b37...a6e3f120fd
@@ -126,11 +126,11 @@ void Systems::TankSteeringSystem::UpdateEntity(double dt, EntityID entity, Entit
|
|||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
// Events::PlaySFX e;
|
Events::PlaySFX e;
|
||||||
// e.Resource = "Sounds/SFX/TankShot.mp3";
|
e.Resource = "Sounds/SFX/TankShot.mp3";
|
||||||
// e.Position = absoluteTransform.Position;
|
e.Position = cloneTransform->Position;
|
||||||
// e.Loop = false;
|
e.Loop = false;
|
||||||
// EventBroker->Publish(e);
|
EventBroker->Publish(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
auto clonePhysicsComponent = m_World->GetComponent<Components::Physics>(clone);
|
auto clonePhysicsComponent = m_World->GetComponent<Components::Physics>(clone);
|
||||||
@@ -225,11 +225,11 @@ bool Systems::TankSteeringSystem::OnCollision(const Events::Collision &e)
|
|||||||
EventBroker->Publish(e);
|
EventBroker->Publish(e);
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
// Events::PlaySFX e;
|
Events::PlaySFX e;
|
||||||
// e.MinDistance = 150.f;
|
e.MinDistance = 150.f;
|
||||||
// e.Position = shellTransform->Position;
|
e.Position = shellTransform->Position;
|
||||||
// e.Resource = "Sounds/SFX/Explosion.wav";
|
e.Resource = "Sounds/SFX/Explosion.wav";
|
||||||
// EventBroker->Publish(e);
|
EventBroker->Publish(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (auto &physComponent : *physicsComponents)
|
for (auto &physComponent : *physicsComponents)
|
||||||
@@ -399,6 +399,7 @@ EntityID Systems::TankSteeringSystem::CreateTank(int playerID)
|
|||||||
m_World->AddComponent<Components::Input>(tank);
|
m_World->AddComponent<Components::Input>(tank);
|
||||||
auto health = m_World->AddComponent<Components::Health>(tank);
|
auto health = m_World->AddComponent<Components::Health>(tank);
|
||||||
health->Amount = 100.f;
|
health->Amount = 100.f;
|
||||||
|
m_World->AddComponent<Components::Listener>(tank);
|
||||||
|
|
||||||
{
|
{
|
||||||
auto shape = m_World->CreateEntity(tank);
|
auto shape = m_World->CreateEntity(tank);
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
#include "Components/Health.h"
|
#include "Components/Health.h"
|
||||||
#include "Components/TankShell.h"
|
#include "Components/TankShell.h"
|
||||||
#include "Components/SphereShape.h"
|
#include "Components/SphereShape.h"
|
||||||
|
#include "Components/Listener.h"
|
||||||
|
|
||||||
#include "Events/EnableCollisions.h"
|
#include "Events/EnableCollisions.h"
|
||||||
#include "Events/DisableCollisions.h"
|
#include "Events/DisableCollisions.h"
|
||||||
|
|||||||
Reference in New Issue
Block a user