mirror of
https://github.com/agateau/pixelwheels.git
synced 2025-10-05 17:32:39 +02:00
Merge pull request #519 from agateau/more-collision-sound-variations
Add more variations to collision sounds
This commit is contained in:
3
.changes/unreleased/Changed-20250915-081737.yaml
Normal file
3
.changes/unreleased/Changed-20250915-081737.yaml
Normal file
@@ -0,0 +1,3 @@
|
||||
kind: Changed
|
||||
body: Collision sound effects are now more varied.
|
||||
time: 2025-09-15T08:17:37.888734856+02:00
|
@@ -40,8 +40,8 @@ class AudioComponent implements Racer.Component, Disposable, Collidable {
|
||||
private static final float FULL_VOLUME_DRIFT_DURATION = 0.6f;
|
||||
private static final float MIN_IMPACT_SPEED = 3;
|
||||
|
||||
private static final float MIN_COLLISION_PITCH = 0.5f;
|
||||
private static final float MAX_COLLISION_PITCH = 2f;
|
||||
private static final float MIN_COLLISION_PITCH = 0.1f;
|
||||
private static final float MAX_COLLISION_PITCH = 4f;
|
||||
|
||||
private static final float ICE_DRIFT_PITCH = 0.5f;
|
||||
|
||||
@@ -115,9 +115,9 @@ class AudioComponent implements Racer.Component, Disposable, Collidable {
|
||||
|
||||
if (mJustCollided) {
|
||||
mCollisionSoundPlayer.setVolume(maxVolume);
|
||||
float pitch = MathUtils.random(MIN_COLLISION_PITCH, MAX_COLLISION_PITCH);
|
||||
mCollisionSoundPlayer.setPitch(pitch);
|
||||
if (!mCollisionSoundPlayer.isLooping()) {
|
||||
float pitch = MathUtils.random(MIN_COLLISION_PITCH, MAX_COLLISION_PITCH);
|
||||
mCollisionSoundPlayer.setPitch(pitch);
|
||||
mCollisionSoundPlayer.loop();
|
||||
}
|
||||
mJustCollided = false;
|
||||
|
Reference in New Issue
Block a user