Volume of sound related to speed of contact

Get help using Construct 2

Post » Tue Feb 11, 2014 5:07 pm

I need a little help in how to implement sound into my game.
I'd like to make it so that when balls collide they play an audio 'clash' sound, but the volume of the sound file is related to the speed at which they collide. Faster collisions being louder than slower ones.

I've had a search on the forums / tutorials and had an attempt, but I am finding it difficult to get a good range of max to min sound volumes.

I've had a play around with the command to set the volume to the bowls.physics and tried things like:
Set volume to: ((P1Bowl1.Physics.VelocityX)/10)-50

The maximum Velocity X of my balls gets up to a value of 1000 down to 0 when stationary. I have manged to get an ok play off between min and max sounds by changing the above.

I will eventually want to implement this so that there are 9 balls on screen and each sound effect is related to the speed of the ball colliding. (At the moment I have put them all as a collision family and done on collision with another from collision family play sound. But this gives the same volume for each effect / collision.)

Does any one know a nicer way I can approach this? I am also hoping to keep it Android compatible.....

Mayfly2014-02-11 17:16:44
Posts: 221
Reputation: 4,613

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 7 guests