Player walk is now based on distance traveled, and it is also reset when key is released. However when dashing the player step sound is still played. The distance of a step is also hard coded in the header file. Will config it up some day.

This commit is contained in:
stiffly
2016-02-05 17:46:27 +01:00
parent 454eef8225
commit becb197feb
4 changed files with 60 additions and 56 deletions
-2
View File
@@ -133,8 +133,6 @@ private:
bool OnShoot(const Events::Shoot &e);
EventRelay<SoundManager, Events::PlayerSpawned> m_EPlayerSpawned;
bool OnPlayerSpawned(const Events::PlayerSpawned &e);
EventRelay<SoundManager, Events::InputCommand> m_EInputCommand;
bool OnInputCommand(const Events::InputCommand &e);
EventRelay<SoundManager, Events::Captured> m_ECaptured;
bool OnCaptured(const Events::Captured &e);
EventRelay<SoundManager, Events::PlayerDamage> m_EPlayerDamage;
+8 -2
View File
@@ -4,6 +4,7 @@
#include "../Engine/Core/System.h"
#include "../Engine/Sound/SoundManager.h"
#include "../Engine/Core/EPlayerSpawned.h"
#include "../Engine/Input/EInputCommand.h"
class SoundSystem : public PureSystem, ImpureSystem, SoundManager
@@ -19,14 +20,19 @@ private:
World* m_World = nullptr;
EventBroker* m_EventBroker = nullptr;
void playerJumps();
// TODO: WIP Update this
double m_DistanceMoved = 0.0;
const float m_PlayerStepLength = 1.0;
float m_DistanceMoved = 0.0f;
const float m_PlayerStepLength = 2.0f;
glm::vec3 m_LastPosition = glm::vec3();
bool m_LeftFoot = false;
EventRelay<SoundSystem, Events::PlayerSpawned> m_EPlayerSpawned;
bool OnPlayerSpawned(const Events::PlayerSpawned &e);
EventRelay<SoundSystem, Events::InputCommand> m_InputCommand;
bool OnInputCommand(const Events::InputCommand &e);
};
#endif