-------------------------------------------------------------------------------- -- Function......... : updateSound -- Author........... : -- Description...... : -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- function Car.updateSound ( ) -------------------------------------------------------------------------------- local speed = math.min ( 20, dynamics.getLinearSpeed ( this.getObject ( ) ) ) / 20 sound.setPitch ( this.getObject ( ), 0, 1 + speed * 3 ) --log.message ( speed ) --sound.setVolume ( this.getObject ( ), 0, 1 - speed ) --sound.setVolume ( this.getObject ( ), 1, speed ) -------------------------------------------------------------------------------- end --------------------------------------------------------------------------------