Skip to content

Commit

Permalink
🐛 Restore Reverse sound
Browse files Browse the repository at this point in the history
  • Loading branch information
TaK0JR committed Apr 29, 2024
1 parent c690ea6 commit 1c7fc77
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/components/PlayerController.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ export const PlayerController = ({
if (player.id !== id) return;
const time = clock.getElapsedTime();
if (!body.current && !mario.current) return;
engineSound.current.setVolume(currentSpeed / 300 + 0.2);
engineSound.current.setPlaybackRate(currentSpeed / 10 + 0.1);
engineSound.current.setVolume(Math.abs(currentSpeed) / 300 + 0.2);
engineSound.current.setPlaybackRate(Math.abs(currentSpeed) / 10 + 0.1);
jumpSound.current.setPlaybackRate(1.5);
jumpSound.current.setVolume(0.5);
driftSound.current.setVolume(0.2);
Expand Down
4 changes: 2 additions & 2 deletions src/components/PlayerControllerGamepad.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ export const PlayerControllerGamepad = ({
const time = clock.getElapsedTime();
if (!body.current && !mario.current) return;
isDrifting.current = driftLeft.current || driftRight.current;
engineSound.current.setVolume(currentSpeed / 300 + 0.2);
engineSound.current.setPlaybackRate(currentSpeed / 10 + 0.1);
engineSound.current.setVolume(Math.abs(currentSpeed) / 300 + 0.2);
engineSound.current.setPlaybackRate(Math.abs(currentSpeed) / 10 + 0.1);
jumpSound.current.setPlaybackRate(1.5);
jumpSound.current.setVolume(0.5);
driftSound.current.setVolume(0.2);
Expand Down
4 changes: 2 additions & 2 deletions src/components/PlayerControllerKeyboard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ export const PlayerControllerKeyboard = ({
if (player.id !== id) return;
const time = clock.getElapsedTime();
if (!body.current && !mario.current) return;
engineSound.current.setVolume(currentSpeed / 300 + 0.2);
engineSound.current.setPlaybackRate(currentSpeed / 10 + 0.1);
engineSound.current.setVolume(Math.abs(currentSpeed) / 300 + 0.2);
engineSound.current.setPlaybackRate(Math.abs(currentSpeed) / 10 + 0.1);
jumpSound.current.setPlaybackRate(1.5);
jumpSound.current.setVolume(0.5);
driftSound.current.setVolume(0.2);
Expand Down
4 changes: 2 additions & 2 deletions src/components/PlayerControllerTouch.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ export const PlayerControllerTouch = ({
if (player.id !== id) return;
const time = clock.getElapsedTime();
if (!body.current && !mario.current) return;
engineSound.current.setVolume(currentSpeed / 300 + 0.2);
engineSound.current.setPlaybackRate(currentSpeed / 10 + 0.1);
engineSound.current.setVolume(Math.abs(currentSpeed) / 300 + 0.2);
engineSound.current.setPlaybackRate(Math.abs(currentSpeed) / 10 + 0.1);
jumpSound.current.setPlaybackRate(1.5);
jumpSound.current.setVolume(0.5);
driftSound.current.setVolume(0.2);
Expand Down

0 comments on commit 1c7fc77

Please sign in to comment.