Pause and Resume events completed and game-crashing bug fixed. I think.
This commit is contained in:
@@ -21,7 +21,8 @@ void dd::Systems::BallSystem::Initialize()
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EStickyPad, &BallSystem::OnStickyPad);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EInkBlaster, &BallSystem::OnInkBlaster);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EInkBlasterOver, &BallSystem::OnInkBlasterOver);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EPause, &BallSystem::OnPause);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EPause, &BallSystem::OnPause);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EResume, &BallSystem::OnResume);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EActionButton, &BallSystem::OnActionButton);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EStageCleared, &BallSystem::OnStageCleared);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EArrivedAtNewStage, &BallSystem::OnArrivedToNewStage);
|
||||
@@ -86,8 +87,13 @@ void dd::Systems::BallSystem::UpdateEntity(double dt, EntityID entity, EntityID
|
||||
{
|
||||
//TODO: When the ball collides with 2 bricks on the same frame it is reflected and then reflected again, make it reflect only once like a list or something?
|
||||
|
||||
if (IsPaused()) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto ballComponent = m_World->GetComponent<Components::Ball>(entity);
|
||||
if (IsPaused()) {
|
||||
|
||||
/*if (IsPaused()) {
|
||||
if (ballComponent != nullptr) {
|
||||
auto transform = m_World->GetComponent<Components::Transform>(entity);
|
||||
|
||||
@@ -107,7 +113,7 @@ void dd::Systems::BallSystem::UpdateEntity(double dt, EntityID entity, EntityID
|
||||
ballComponent->Paused = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
auto templateCheck = m_World->GetComponent<Components::Template>(entity);
|
||||
if (templateCheck != nullptr){ return; }
|
||||
@@ -211,18 +217,26 @@ void dd::Systems::BallSystem::UpdateEntity(double dt, EntityID entity, EntityID
|
||||
|
||||
bool dd::Systems::BallSystem::OnPause(const dd::Events::Pause &event)
|
||||
{
|
||||
if (event.Type != "BallSystem" && event.Type != "All") {
|
||||
/*if (event.Type != "BallSystem" && event.Type != "All") {
|
||||
return false;
|
||||
}
|
||||
}*/
|
||||
|
||||
m_Pause = true;
|
||||
|
||||
if (IsPaused()) {
|
||||
SetPause(false);
|
||||
} else {
|
||||
SetPause(true);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool dd::Systems::BallSystem::OnResume(const dd::Events::Resume &event)
|
||||
{
|
||||
/*if (event.Type != "BallSystem" && event.Type != "All") {
|
||||
return false;
|
||||
}*/
|
||||
|
||||
m_Pause = false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void dd::Systems::BallSystem::OnEntityCommit(EntityID entity)
|
||||
{
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
void dd::Systems::HitLagSystem::Initialize()
|
||||
{
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EPause, &HitLagSystem::OnPause);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EResume, &HitLagSystem::OnResume);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EHitLag, &HitLagSystem::OnHitLag);
|
||||
}
|
||||
|
||||
@@ -29,25 +30,33 @@ void dd::Systems::HitLagSystem::Update(double dt)
|
||||
|
||||
void dd::Systems::HitLagSystem::FlipPause()
|
||||
{
|
||||
Events::Pause e;
|
||||
e.Type = CurrentType();
|
||||
EventBroker->Publish(e);
|
||||
if (!IsPaused()) {
|
||||
Events::Pause e;
|
||||
e.Type = CurrentType();
|
||||
EventBroker->Publish(e);
|
||||
} else {
|
||||
Events::Resume e;
|
||||
e.Type = CurrentType();
|
||||
EventBroker->Publish(e);
|
||||
}
|
||||
}
|
||||
|
||||
bool dd::Systems::HitLagSystem::OnPause(const dd::Events::Pause &event)
|
||||
{
|
||||
if (IsPaused()) {
|
||||
SetPause(false);
|
||||
} else {
|
||||
SetPause(true);
|
||||
}
|
||||
m_Pause = true;
|
||||
return true;
|
||||
}
|
||||
bool dd::Systems::HitLagSystem::OnResume(const dd::Events::Resume &event)
|
||||
{
|
||||
m_Pause = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool dd::Systems::HitLagSystem::OnHitLag(const dd::Events::HitLag &event)
|
||||
{
|
||||
if (HitLag()) {
|
||||
FlipPause();
|
||||
SetHitLagTimer(0);
|
||||
}
|
||||
SetHitLag(true);
|
||||
SetCurrentType(event.Type);
|
||||
|
||||
@@ -10,6 +10,7 @@ void dd::Systems::KrakenSystem::Initialize()
|
||||
std::random_device rd;
|
||||
m_RandomGenerator = std::mt19937(rd());
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EPause, &KrakenSystem::OnPause);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EResume, &KrakenSystem::OnResume);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EKrakenAppear, &KrakenSystem::OnKrakenAppear);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EKrakenAttack, &KrakenSystem::OnKrakenAttack);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EBrickGenerating, &KrakenSystem::OnBrickGenerating);
|
||||
@@ -51,7 +52,9 @@ void dd::Systems::KrakenSystem::InitializeObjects()
|
||||
|
||||
void dd::Systems::KrakenSystem::Update(double dt)
|
||||
{
|
||||
|
||||
if (m_Pause) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void dd::Systems::KrakenSystem::UpdateEntity(double dt, EntityID entity, EntityID parent)
|
||||
@@ -105,18 +108,24 @@ void dd::Systems::KrakenSystem::UpdateEntity(double dt, EntityID entity, EntityI
|
||||
|
||||
bool dd::Systems::KrakenSystem::OnPause(const dd::Events::Pause &event)
|
||||
{
|
||||
if (event.Type != "KrakenSystem" && event.Type != "All") {
|
||||
/*if (event.Type != "KrakenSystem" && event.Type != "All") {
|
||||
return false;
|
||||
}
|
||||
}*/
|
||||
|
||||
m_Pause = true;
|
||||
|
||||
if (IsPaused()) {
|
||||
SetPause(false);
|
||||
} else {
|
||||
SetPause(true);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool dd::Systems::KrakenSystem::OnResume(const dd::Events::Resume &event)
|
||||
{
|
||||
/*if (event.Type != "KrakenSystem" && event.Type != "All") {
|
||||
return false;
|
||||
}*/
|
||||
m_Pause = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool dd::Systems::KrakenSystem::OnKrakenAppear(const dd::Events::KrakenAppear &event)
|
||||
{
|
||||
auto ent = m_World->CloneEntity(m_KrakenTemplate);
|
||||
|
||||
@@ -19,6 +19,7 @@ void dd::Systems::LevelSystem::Initialize()
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EPowerUpTaken, &LevelSystem::OnPowerUpTaken);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EStageCleared, &LevelSystem::OnStageCleared);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EPause, &LevelSystem::OnPause);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EResume, &LevelSystem::OnResume);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EHitPad, &LevelSystem::OnHitPad);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EBrickGenerating, &LevelSystem::OnBrickGenerating);
|
||||
|
||||
@@ -338,18 +339,24 @@ void dd::Systems::LevelSystem::UpdateEntity(double dt, EntityID entity, EntityID
|
||||
|
||||
bool dd::Systems::LevelSystem::OnPause(const dd::Events::Pause &event)
|
||||
{
|
||||
if (event.Type != "LevelSystem" && event.Type != "All") {
|
||||
/*if (event.Type != "LevelSystem" && event.Type != "All") {
|
||||
return false;
|
||||
}
|
||||
}*/
|
||||
|
||||
m_Pause = true;
|
||||
|
||||
if (IsPaused()) {
|
||||
SetPause(false);
|
||||
} else {
|
||||
SetPause(true);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool dd::Systems::LevelSystem::OnResume(const dd::Events::Resume &event)
|
||||
{
|
||||
/*if (event.Type != "LevelSystem" && event.Type != "All") {
|
||||
return false;
|
||||
}*/
|
||||
m_Pause = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void dd::Systems::LevelSystem::CreateBasicLevel(int rows, int lines, glm::vec2 spacesBetweenBricks, float spaceToEdge)
|
||||
{
|
||||
SetNumberOfBricks(rows * lines);
|
||||
|
||||
@@ -11,6 +11,7 @@ void dd::Systems::LifebuoySystem::Initialize()
|
||||
{
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EContact, &LifebuoySystem::OnContact);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EPause, &LifebuoySystem::OnPause);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EResume, &LifebuoySystem::OnResume);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_ELifebuoy, &LifebuoySystem::OnLifebuoy);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_ELifebuoyHit, &LifebuoySystem::OnLifebuoyHit);
|
||||
|
||||
@@ -88,18 +89,23 @@ void dd::Systems::LifebuoySystem::UpdateEntity(double dt, EntityID entity, Entit
|
||||
|
||||
bool dd::Systems::LifebuoySystem::OnPause(const dd::Events::Pause &event)
|
||||
{
|
||||
if (event.Type != "LifebuoySystem" && event.Type != "All") {
|
||||
/*if (event.Type != "LifebuoySystem" && event.Type != "All") {
|
||||
return false;
|
||||
}
|
||||
}*/
|
||||
|
||||
m_Pause = true;
|
||||
|
||||
if (IsPaused()) {
|
||||
SetPause(false);
|
||||
} else {
|
||||
SetPause(true);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool dd::Systems::LifebuoySystem::OnResume(const dd::Events::Resume &event)
|
||||
{
|
||||
/*if (event.Type != "LifebuoySystem" && event.Type != "All") {
|
||||
return false;
|
||||
}*/
|
||||
m_Pause = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool dd::Systems::LifebuoySystem::OnContact(const dd::Events::Contact &event)
|
||||
{
|
||||
|
||||
+27
-10
@@ -31,6 +31,7 @@ void dd::Systems::PadSystem::Initialize()
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EResetAll, &PadSystem::OnResetAll);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_ERaiseWater, &PadSystem::OnRaiseWater);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EPause, &PadSystem::OnPause);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EResume, &PadSystem::OnResume);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EKrakenAttack, &PadSystem::OnKrakenAttack);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EStickyPad, &PadSystem::OnStickyPad);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EStickyAttachedToPad, &PadSystem::OnStickyAttachedToPad);
|
||||
@@ -80,6 +81,10 @@ void dd::Systems::PadSystem::Initialize()
|
||||
|
||||
void dd::Systems::PadSystem::UpdateEntity(double dt, EntityID entity, EntityID parent)
|
||||
{
|
||||
if (m_Pause) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto templateCheck = m_World->GetComponent<Components::Template>(entity);
|
||||
if (templateCheck != nullptr){ return; }
|
||||
|
||||
@@ -176,18 +181,24 @@ void dd::Systems::PadSystem::Update(double dt)
|
||||
|
||||
bool dd::Systems::PadSystem::OnPause(const dd::Events::Pause &event)
|
||||
{
|
||||
if (event.Type != "PadSystem" && event.Type != "All") {
|
||||
/*if (event.Type != "PadSystem" && event.Type != "All") {
|
||||
return false;
|
||||
}
|
||||
}*/
|
||||
|
||||
m_Pause = true;
|
||||
|
||||
if (IsPaused()) {
|
||||
SetPause(false);
|
||||
} else {
|
||||
SetPause(true);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool dd::Systems::PadSystem::OnResume(const dd::Events::Resume &event)
|
||||
{
|
||||
/*if (event.Type != "PadSystem" && event.Type != "All") {
|
||||
return false;
|
||||
}*/
|
||||
m_Pause = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool dd::Systems::PadSystem::OnKeyDown(const dd::Events::KeyDown &event) {
|
||||
int val = event.KeyCode;
|
||||
if (val == GLFW_KEY_UP) {
|
||||
@@ -217,9 +228,15 @@ bool dd::Systems::PadSystem::OnKeyDown(const dd::Events::KeyDown &event) {
|
||||
e.padTransform = Transform();
|
||||
EventBroker->Publish(e);
|
||||
} else if (val == GLFW_KEY_P) {
|
||||
Events::Pause e;
|
||||
e.Type = "All";
|
||||
EventBroker->Publish(e);
|
||||
if (IsPaused()) {
|
||||
Events::Resume e;
|
||||
e.Type = "All";
|
||||
EventBroker->Publish(e);
|
||||
} else {
|
||||
Events::Pause e;
|
||||
e.Type = "All";
|
||||
EventBroker->Publish(e);
|
||||
}
|
||||
} else if (val == GLFW_KEY_H) {
|
||||
Events::HitLag e;
|
||||
e.Time = 0.2;
|
||||
|
||||
@@ -11,6 +11,7 @@ void dd::Systems::ProjectileSystem::Initialize()
|
||||
{
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EContact, &ProjectileSystem::OnContact);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EPause, &ProjectileSystem::OnPause);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EResume, &ProjectileSystem::OnResume);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EInkBlaster, &ProjectileSystem::OnInkBlaster);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EHitPad, &ProjectileSystem::OnHitPad);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EActionButton, &ProjectileSystem::OnActionButton);
|
||||
@@ -45,7 +46,9 @@ void dd::Systems::ProjectileSystem::Initialize()
|
||||
|
||||
void dd::Systems::ProjectileSystem::Update(double dt)
|
||||
{
|
||||
|
||||
if (m_Pause) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void dd::Systems::ProjectileSystem::UpdateEntity(double dt, EntityID entity, EntityID parent)
|
||||
@@ -67,18 +70,23 @@ void dd::Systems::ProjectileSystem::UpdateEntity(double dt, EntityID entity, Ent
|
||||
|
||||
bool dd::Systems::ProjectileSystem::OnPause(const dd::Events::Pause &event)
|
||||
{
|
||||
if (event.Type != "ProjectileSystem" && event.Type != "All") {
|
||||
/*if (event.Type != "ProjectileSystem" && event.Type != "All") {
|
||||
return false;
|
||||
}
|
||||
}*/
|
||||
|
||||
m_Pause = true;
|
||||
|
||||
if (IsPaused()) {
|
||||
SetPause(false);
|
||||
} else {
|
||||
SetPause(true);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool dd::Systems::ProjectileSystem::OnResume(const dd::Events::Resume &event)
|
||||
{
|
||||
/*if (event.Type != "ProjectileSystem" && event.Type != "All") {
|
||||
return false;
|
||||
}*/
|
||||
m_Pause = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool dd::Systems::ProjectileSystem::OnContact(const dd::Events::Contact &event)
|
||||
{
|
||||
|
||||
@@ -10,6 +10,7 @@ void dd::Systems::ScreenShakeSystem::Initialize()
|
||||
std::random_device rd;
|
||||
m_RandomGenerator = std::mt19937(rd());
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EPause, &ScreenShakeSystem::OnPause);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EResume, &ScreenShakeSystem::OnResume);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EScreenShake, &ScreenShakeSystem::OnScreenShake);
|
||||
|
||||
InitializeObjects();
|
||||
@@ -77,17 +78,21 @@ void dd::Systems::ScreenShakeSystem::UpdateEntity(double dt, EntityID entity, En
|
||||
|
||||
bool dd::Systems::ScreenShakeSystem::OnPause(const dd::Events::Pause &event)
|
||||
{
|
||||
if (event.Type != "ScreenShakeSystem" && event.Type != "All") {
|
||||
/*if (event.Type != "ScreenShakeSystem" && event.Type != "All") {
|
||||
return false;
|
||||
}
|
||||
}*/
|
||||
|
||||
if (IsPaused()) {
|
||||
SetPause(false);
|
||||
} else {
|
||||
SetPause(true);
|
||||
}
|
||||
m_Pause = true;
|
||||
return true;
|
||||
}
|
||||
bool dd::Systems::ScreenShakeSystem::OnResume(const dd::Events::Resume &event)
|
||||
{
|
||||
/*if (event.Type != "ScreenShakeSystem" && event.Type != "All") {
|
||||
return false;
|
||||
}*/
|
||||
m_Pause = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool dd::Systems::ScreenShakeSystem::OnScreenShake(const dd::Events::ScreenShake &event)
|
||||
{
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
void dd::Systems::TravellingSystem::Initialize()
|
||||
{
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EPause, &TravellingSystem::OnPause);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EResume, &TravellingSystem::OnResume);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EStageCleared, &TravellingSystem::OnStageCleared);
|
||||
}
|
||||
|
||||
@@ -30,6 +31,10 @@ void dd::Systems::TravellingSystem::Update(double dt)
|
||||
|
||||
void dd::Systems::TravellingSystem::UpdateEntity(double dt, EntityID entity, EntityID parent)
|
||||
{
|
||||
if (m_Pause) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto templateCheck = m_World->GetComponent<Components::Template>(entity);
|
||||
if (templateCheck != nullptr){ return; }
|
||||
|
||||
@@ -75,17 +80,20 @@ void dd::Systems::TravellingSystem::UpdateEntity(double dt, EntityID entity, Ent
|
||||
|
||||
bool dd::Systems::TravellingSystem::OnPause(const dd::Events::Pause &event)
|
||||
{
|
||||
if (event.Type != "TravellingSystem" && event.Type != "All") {
|
||||
/*if (event.Type != "TravellingSystem" && event.Type != "All") {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (IsPaused()) {
|
||||
SetPause(false);
|
||||
} else {
|
||||
SetPause(true);
|
||||
}
|
||||
}*/
|
||||
m_Pause = true;
|
||||
return true;
|
||||
}
|
||||
bool dd::Systems::TravellingSystem::OnResume(const dd::Events::Resume &event)
|
||||
{
|
||||
/*if (event.Type != "TravellingSystem" && event.Type != "All") {
|
||||
return false;
|
||||
}*/
|
||||
m_Pause = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool dd::Systems::TravellingSystem::OnStageCleared(const dd::Events::StageCleared &event)
|
||||
{
|
||||
|
||||
@@ -23,6 +23,7 @@ void dd::Systems::PhysicsSystem::Initialize()
|
||||
InitializeWater();
|
||||
EVENT_SUBSCRIBE_MEMBER(m_SetImpulse, &PhysicsSystem::SetImpulse);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EPause, &PhysicsSystem::OnPause);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EResume, &PhysicsSystem::OnResume);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_ECreateParticleSequence, &PhysicsSystem::CreateParticleSequence);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EContact, &PhysicsSystem::OnContact);
|
||||
}
|
||||
@@ -244,6 +245,10 @@ void dd::Systems::PhysicsSystem::Update(double dt)
|
||||
|
||||
void dd::Systems::PhysicsSystem::UpdateEntity(double dt, EntityID entity, EntityID parent)
|
||||
{
|
||||
if (m_Pause) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto particle = m_World->GetComponent<Components::Particle>(entity);
|
||||
auto pTemplate = m_World->GetComponent<Components::Template>(entity);
|
||||
|
||||
@@ -333,18 +338,22 @@ glm::vec3 dd::Systems::PhysicsSystem::VectorInterpolation(float timeProgress, st
|
||||
|
||||
bool dd::Systems::PhysicsSystem::OnPause(const dd::Events::Pause &event)
|
||||
{
|
||||
if (event.Type != "PhysicsSystem" && event.Type != "All") {
|
||||
/*if (event.Type != "PhysicsSystem" && event.Type != "All") {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (m_Pause) {
|
||||
m_Pause = false;
|
||||
} else {
|
||||
m_Pause = true;
|
||||
}
|
||||
}*/
|
||||
m_Pause = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool dd::Systems::PhysicsSystem::OnResume(const dd::Events::Resume &event)
|
||||
{
|
||||
/*if (event.Type != "PhysicsSystem" && event.Type != "All") {
|
||||
return false;
|
||||
}*/
|
||||
m_Pause = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void dd::Systems::PhysicsSystem::OnEntityCommit(EntityID entity)
|
||||
{
|
||||
auto physicsComponent = m_World->GetComponent<Components::Physics>(entity);
|
||||
|
||||
@@ -9,6 +9,7 @@ void dd::Systems::AnimationSystem::RegisterComponents(ComponentFactory* cf)
|
||||
void dd::Systems::AnimationSystem::Initialize()
|
||||
{
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EPause, &AnimationSystem::OnPause);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EResume, &AnimationSystem::OnResume);
|
||||
}
|
||||
|
||||
void dd::Systems::AnimationSystem::Update(double dt)
|
||||
@@ -30,6 +31,12 @@ void dd::Systems::AnimationSystem::Update(double dt)
|
||||
|
||||
bool dd::Systems::AnimationSystem::OnPause(const Events::Pause& e)
|
||||
{
|
||||
m_Paused = !m_Paused;
|
||||
m_Paused = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool dd::Systems::AnimationSystem::OnResume(const Events::Resume& e)
|
||||
{
|
||||
m_Paused = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user