Volume of sound related to speed of contact

0 favourites
  • 1 posts
From the Asset Store
Have you ever dreamed of playing in a Speedball game or tournament?
  • 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.....


  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)