O'Reilly logo

GameMaker Cookbook by Brandon Gardiner

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Replicating the Doppler effect with emitters

If you've ever stood by the side of a road as cars pass by, you've experienced the Doppler effect. Without getting into too much detail, the Doppler effect is the change in frequency of a wave (in this case, a sound wave) for an observer moving relative to its source. In the case of a car moving by a stationary observer (that is, you), the sound waves caused by the car's engine are being emitted closer together as the car approaches than they are as the car recedes. That's why a car emits a higher pitch noise the closer it gets and a lower pitch noise as it passes by and drives away. With the help of GameMaker's 3D audio functions, we can actually recreate this effect.

Getting ready

Once again, we'll ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required