summary refs log tree commit diff stats
path: root/src/systems/orienting.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/systems/orienting.cpp')
-rw-r--r--src/systems/orienting.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/systems/orienting.cpp b/src/systems/orienting.cpp index 206ebf6..d73ddd2 100644 --- a/src/systems/orienting.cpp +++ b/src/systems/orienting.cpp
@@ -24,27 +24,27 @@ void OrientingSystem::tick(double)
24 { 24 {
25 case OrientableComponent::WalkState::still: 25 case OrientableComponent::WalkState::still:
26 { 26 {
27 ponderable.velX = 0.0; 27 ponderable.vel.x() = 0.0;
28 28
29 break; 29 break;
30 } 30 }
31 31
32 case OrientableComponent::WalkState::left: 32 case OrientableComponent::WalkState::left:
33 { 33 {
34 ponderable.velX = -WALK_SPEED; 34 ponderable.vel.x() = -WALK_SPEED;
35 35
36 break; 36 break;
37 } 37 }
38 38
39 case OrientableComponent::WalkState::right: 39 case OrientableComponent::WalkState::right:
40 { 40 {
41 ponderable.velX = WALK_SPEED; 41 ponderable.vel.x() = WALK_SPEED;
42 42
43 break; 43 break;
44 } 44 }
45 } 45 }
46 46
47 if (orientable.isJumping() && (ponderable.velY > 0)) 47 if (orientable.isJumping() && (ponderable.vel.y() > 0))
48 { 48 {
49 orientable.setJumping(false); 49 orientable.setJumping(false);
50 } 50 }
@@ -122,8 +122,8 @@ void OrientingSystem::jump(id_type entity)
122 122
123 playSound("res/Randomize87.wav", 0.25); 123 playSound("res/Randomize87.wav", 0.25);
124 124
125 ponderable.velY = JUMP_VELOCITY; 125 ponderable.vel.y() = JUMP_VELOCITY;
126 ponderable.accelY = JUMP_GRAVITY; 126 ponderable.accel.y() = JUMP_GRAVITY;
127 127
128 auto& animating = game_.getSystemManager().getSystem<AnimatingSystem>(); 128 auto& animating = game_.getSystemManager().getSystem<AnimatingSystem>();
129 if (orientable.isFacingRight()) 129 if (orientable.isFacingRight())
@@ -147,7 +147,7 @@ void OrientingSystem::stopJumping(id_type entity)
147 auto& ponderable = game_.getEntityManager(). 147 auto& ponderable = game_.getEntityManager().
148 getComponent<PonderableComponent>(entity); 148 getComponent<PonderableComponent>(entity);
149 149
150 ponderable.accelY = NORMAL_GRAVITY; 150 ponderable.accel.y() = NORMAL_GRAVITY;
151 } 151 }
152} 152}
153 153