summary refs log tree commit diff stats
path: root/src/systems/orienting.cpp
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2018-02-18 15:25:52 -0500
committerKelly Rauchenberger <fefferburbia@gmail.com>2018-02-18 15:25:52 -0500
commite4e2f2d2a7b6a282b9618aa0004d9453936f43c6 (patch)
treede1653dc8b5992420147f28d9fb4de052ea1845f /src/systems/orienting.cpp
parente16fb5be90c889c371cbb0ca2444735c2e12073c (diff)
downloadtherapy-e4e2f2d2a7b6a282b9618aa0004d9453936f43c6.tar.gz
therapy-e4e2f2d2a7b6a282b9618aa0004d9453936f43c6.tar.bz2
therapy-e4e2f2d2a7b6a282b9618aa0004d9453936f43c6.zip
Added player death and event scheduling
Also added ability to make sprites flicker, to freeze physics for an entity, and to freeze progression of a sprite's animation loop.
Diffstat (limited to 'src/systems/orienting.cpp')
-rw-r--r--src/systems/orienting.cpp18
1 files changed, 6 insertions, 12 deletions
diff --git a/src/systems/orienting.cpp b/src/systems/orienting.cpp index 187bebc..2df8f87 100644 --- a/src/systems/orienting.cpp +++ b/src/systems/orienting.cpp
@@ -93,24 +93,18 @@ void OrientingSystem::moveRight(id_type entity)
93 93
94void OrientingSystem::stopWalking(id_type entity) 94void OrientingSystem::stopWalking(id_type entity)
95{ 95{
96 auto& ponderable = game_.getEntityManager().
97 getComponent<PonderableComponent>(entity);
98
99 auto& orientable = game_.getEntityManager(). 96 auto& orientable = game_.getEntityManager().
100 getComponent<OrientableComponent>(entity); 97 getComponent<OrientableComponent>(entity);
101 98
102 orientable.setWalkState(OrientableComponent::WalkState::still); 99 orientable.setWalkState(OrientableComponent::WalkState::still);
103 100
104 if (ponderable.isGrounded()) 101 auto& animating = game_.getSystemManager().getSystem<AnimatingSystem>();
105 {
106 auto& animating = game_.getSystemManager().getSystem<AnimatingSystem>();
107 102
108 if (orientable.isFacingRight()) 103 if (orientable.isFacingRight())
109 { 104 {
110 animating.startAnimation(entity, "stillRight"); 105 animating.startAnimation(entity, "stillRight");
111 } else { 106 } else {
112 animating.startAnimation(entity, "stillLeft"); 107 animating.startAnimation(entity, "stillLeft");
113 }
114 } 108 }
115} 109}
116 110