Skip to content

Commit 3f9fdcd

Browse files
committed
🔨 Add time shift SFX again
1 parent 6f24723 commit 3f9fdcd

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

Diff for: src/engine/audio/audio_engine.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ void AudioChannel::update(float deltaTime) {
2121
if (!m_active || !m_currentFile)
2222
return;
2323

24+
// Don't let the speed change too quickly
2425
m_currentSpeed = std::lerp(m_currentSpeed, m_targetSpeed, deltaTime * 8.0f);
2526

2627
if (m_fadeTimeRemaining > 0.0f) {

Diff for: src/game/main.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ struct Spinny {
3636
struct TimeScaleState {
3737
float currentScale = 1.0f;
3838
float targetScale = 1.0f;
39-
float transitionSpeed = 0.1f; // Adjust this to control smoothing speed
39+
float transitionSpeed = 0.3f; // Adjust this to control smoothing speed
4040
};
4141

4242
int main(int argc, char *argv[]) {
@@ -197,17 +197,17 @@ int main(int argc, char *argv[]) {
197197
case SDLK_1:
198198
timeScale->targetScale = 0.5f;
199199
audioEngine.setSpeed(0.5f);
200-
// audioEngine.playSound("./assets/sfx/slowdown.wav");
200+
audioEngine.playSound("./assets/sfx/slowdown.wav");
201201
break;
202202
case SDLK_2:
203203
timeScale->targetScale = 1.0f;
204204
audioEngine.setSpeed(1.0f);
205-
// audioEngine.playSound("./assets/sfx/slowdown.wav");
205+
audioEngine.playSound("./assets/sfx/slowdown.wav");
206206
break;
207207
case SDLK_3:
208208
timeScale->targetScale = 2.0f;
209209
audioEngine.setSpeed(2.0f);
210-
// audioEngine.playSound("./assets/sfx/slowdown.wav");
210+
audioEngine.playSound("./assets/sfx/slowdown.wav");
211211
break;
212212
case SDLK_SPACE:
213213
audioEngine.playSound("./assets/sfx/real-trap-shit.wav");

0 commit comments

Comments
 (0)