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.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/systems/orienting.cpp b/src/systems/orienting.cpp index 2df8f87..206ebf6 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.setVelocityX(0); 27 ponderable.velX = 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.setVelocityX(-WALK_SPEED); 34 ponderable.velX = -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.setVelocityX(WALK_SPEED); 41 ponderable.velX = WALK_SPEED;
42 42
43 break; 43 break;
44 } 44 }
45 } 45 }
46 46
47 if (orientable.isJumping() && (ponderable.getVelocityY() > 0)) 47 if (orientable.isJumping() && (ponderable.velY > 0))
48 { 48 {
49 orientable.setJumping(false); 49 orientable.setJumping(false);
50 } 50 }
@@ -63,7 +63,7 @@ void OrientingSystem::moveLeft(id_type entity)
63 orientable.setWalkState(OrientableComponent::WalkState::left); 63 orientable.setWalkState(OrientableComponent::WalkState::left);
64 64
65 auto& animating = game_.getSystemManager().getSystem<AnimatingSystem>(); 65 auto& animating = game_.getSystemManager().getSystem<AnimatingSystem>();
66 if (ponderable.isGrounded()) 66 if (ponderable.grounded)
67 { 67 {
68 animating.startAnimation(entity, "walkingLeft"); 68 animating.startAnimation(entity, "walkingLeft");
69 } else { 69 } else {
@@ -83,7 +83,7 @@ void OrientingSystem::moveRight(id_type entity)
83 orientable.setWalkState(OrientableComponent::WalkState::right); 83 orientable.setWalkState(OrientableComponent::WalkState::right);
84 84
85 auto& animating = game_.getSystemManager().getSystem<AnimatingSystem>(); 85 auto& animating = game_.getSystemManager().getSystem<AnimatingSystem>();
86 if (ponderable.isGrounded()) 86 if (ponderable.grounded)
87 { 87 {
88 animating.startAnimation(entity, "walkingRight"); 88 animating.startAnimation(entity, "walkingRight");
89 } else { 89 } else {
@@ -113,7 +113,7 @@ void OrientingSystem::jump(id_type entity)
113 auto& ponderable = game_.getEntityManager(). 113 auto& ponderable = game_.getEntityManager().
114 getComponent<PonderableComponent>(entity); 114 getComponent<PonderableComponent>(entity);
115 115
116 if (ponderable.isGrounded()) 116 if (ponderable.grounded)
117 { 117 {
118 auto& orientable = game_.getEntityManager(). 118 auto& orientable = game_.getEntityManager().
119 getComponent<OrientableComponent>(entity); 119 getComponent<OrientableComponent>(entity);
@@ -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.setVelocityY(JUMP_VELOCITY); 125 ponderable.velY = JUMP_VELOCITY;
126 ponderable.setAccelY(JUMP_GRAVITY); 126 ponderable.accelY = 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.setAccelY(NORMAL_GRAVITY); 150 ponderable.accelY = NORMAL_GRAVITY;
151 } 151 }
152} 152}
153 153
@@ -211,7 +211,7 @@ void OrientingSystem::drop(id_type entity)
211 auto& ponderable = game_.getEntityManager(). 211 auto& ponderable = game_.getEntityManager().
212 getComponent<PonderableComponent>(entity); 212 getComponent<PonderableComponent>(entity);
213 213
214 if (ponderable.isGrounded() 214 if (ponderable.grounded
215 && (orientable.getDropState() == OrientableComponent::DropState::none)) 215 && (orientable.getDropState() == OrientableComponent::DropState::none))
216 { 216 {
217 orientable.setDropState(OrientableComponent::DropState::ready); 217 orientable.setDropState(OrientableComponent::DropState::ready);