summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--src/character_system.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/character_system.cpp b/src/character_system.cpp index 368505e..695e8f5 100644 --- a/src/character_system.cpp +++ b/src/character_system.cpp
@@ -180,11 +180,6 @@ void CharacterSystem::tick(double dt) {
180 } 180 }
181 } 181 }
182 182
183 if (collision.blocked && sprite.characterState == CharacterState::Running && !sprite.clipping) {
184 stopRunning(spriteId);
185 game_.getMixer().playSound("../res/sfx/bump.wav");
186 }
187
188 // Move everything 183 // Move everything
189 if (pLoc != sprite.loc) { 184 if (pLoc != sprite.loc) {
190 game_.getSystem<TransformSystem>().moveSprite(spriteId, pLoc); 185 game_.getSystem<TransformSystem>().moveSprite(spriteId, pLoc);
@@ -231,6 +226,12 @@ void CharacterSystem::tick(double dt) {
231 pNext.trail.pop_front(); 226 pNext.trail.pop_front();
232 pNext.trail.push_back({.pos = pLoc, .dir = sprite.dir, .medium = sprite.characterMedium}); 227 pNext.trail.push_back({.pos = pLoc, .dir = sprite.dir, .medium = sprite.characterMedium});
233 } 228 }
229 } else {
230 // We haven't moved at all.
231 if (sprite.characterState == CharacterState::Running) {
232 stopRunning(spriteId);
233 game_.getMixer().playSound("../res/sfx/bump.wav");
234 }
234 } 235 }
235 } 236 }
236 } 237 }